"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestError = void 0;
const core_base_1 = require("@applitools/core-base");
class TestError extends core_base_1.CoreError {
    constructor(result) {
        if (result.status === 'Failed') {
            super(`Test '${result.name}' of '${result.appName}' is failed! See details at ${result.url}`, {
                reason: 'test failed',
                result,
            });
        }
        else if (result.status === 'Unresolved') {
            if (result.isNew) {
                super(`Test '${result.name}' of '${result.appName}' is new! Please approve the new baseline at ${result.url}`, {
                    reason: 'test new',
                    result,
                });
            }
            else {
                super(`Test '${result.name}' of '${result.appName}' detected differences! See details at: ${result.url}`, {
                    reason: 'test different',
                    result,
                });
            }
        }
        else {
            super('');
        }
    }
}
exports.TestError = TestError;
