"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const template_1 = require("./template");
const template_mock_1 = require("./template.mock");
describe('template', () => {
    it('Render valid templates', () => {
        expect((0, template_1.renderTemplatedUrl)(template_mock_1.templateWithRawValueReference.template, template_mock_1.valueMock, template_mock_1.rowMock)).toBe(template_mock_1.templateWithRawValueReference.expectedUrl);
        expect((0, template_1.renderTemplatedUrl)(template_mock_1.templateWithFormattedValueReference.template, template_mock_1.valueMock, template_mock_1.rowMock)).toBe(template_mock_1.templateWithFormattedValueReference.expectedUrl);
        expect((0, template_1.renderTemplatedUrl)(template_mock_1.templateWithRowReference.template, template_mock_1.valueMock, template_mock_1.rowMock)).toBe(template_mock_1.templateWithRowReference.expectedUrl);
        expect((0, template_1.renderTemplatedUrl)(template_mock_1.templateWithMultipleRowReferences.template, template_mock_1.valueMock, template_mock_1.rowMock)).toBe(template_mock_1.templateWithMultipleRowReferences.expectedUrl);
    });
    it('Get row dependencies from valid templates', () => {
        expect((0, template_1.getTemplatedUrlRowDependencies)(template_mock_1.templateWithRawValueReference.template)).toStrictEqual(template_mock_1.templateWithRawValueReference.expectedRowReferences);
        expect((0, template_1.getTemplatedUrlRowDependencies)(template_mock_1.templateWithFormattedValueReference.template)).toStrictEqual(template_mock_1.templateWithFormattedValueReference.expectedRowReferences);
        expect((0, template_1.getTemplatedUrlRowDependencies)(template_mock_1.templateWithRowReference.template)).toStrictEqual(template_mock_1.templateWithRowReference.expectedRowReferences);
        expect((0, template_1.getTemplatedUrlRowDependencies)(template_mock_1.templateWithMultipleRowReferences.template)).toStrictEqual(template_mock_1.templateWithMultipleRowReferences.expectedRowReferences);
    });
    it('Throw error when template has invalid reference', () => {
        expect(() => (0, template_1.getTemplatedUrlRowDependencies)(template_mock_1.templateWithInvalidReference.template)).toThrow(template_mock_1.templateWithInvalidReference.expectedError);
        expect(() => (0, template_1.getTemplatedUrlRowDependencies)(template_mock_1.templateWithRowReferenceAndInvalidReference.template)).toThrow(template_mock_1.templateWithRowReferenceAndInvalidReference.expectedError);
    });
});
//# sourceMappingURL=template.test.js.map