"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var ErrorPopup_1 = require("../../../ErrorPopup");
var errors_1 = require("./errors");
describe('errors helpers tests', function () {
    beforeAll(function () {
        jest.spyOn(ErrorPopup_1.ErrorPopup, 'addError').mockImplementation(function () { });
    });
    beforeEach(function () {
        jest.clearAllMocks();
    });
    describe('showWorkflowError behavior', function () {
        it('should show workflow error', function () {
            (0, errors_1.showWorkflowError)({
                status: 'failed',
                error: {
                    errorMessage: 'alarm!',
                    errorCode: 123
                }
            });
            expect(ErrorPopup_1.ErrorPopup.addError).toHaveBeenCalledWith({
                title: 'Error',
                message: 'alarm!'
            });
        });
        it('should do nothing in case of ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR', function () {
            (0, errors_1.showWorkflowError)({
                status: 'failed',
                error: {
                    errorMessage: '',
                    errorCode: mdm_sdk_1.ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR
                }
            });
            expect(ErrorPopup_1.ErrorPopup.addError).not.toHaveBeenCalled();
        });
    });
});
