"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_1 = require("lodash");
const vitest_1 = require("vitest");
const initial_app_js_1 = __importDefault(require("../../../utils/pageFixtures/v6/initial_app.js"));
const nested_modal_js_1 = __importDefault(require("../../../utils/pageFixtures/v6/nested_modal.js"));
const slideout_without_child_js_1 = __importDefault(require("../../../utils/pageFixtures/v6/slideout_without_child.js"));
const with_2_modals_js_1 = __importDefault(require("../../../utils/pageFixtures/v6/with_2_modals.js"));
const with_main_canvas_children_js_1 = __importDefault(require("../../../utils/pageFixtures/v6/with_main_canvas_children.js"));
const with_slideouts_js_1 = __importDefault(require("../../../utils/pageFixtures/v6/with_slideouts.js"));
const with_widgets_named_page_js_1 = __importDefault(require("../../../utils/pageFixtures/v6/with_widgets_named_page.js"));
const v6to7_js_1 = require("./v6to7.js");
(0, vitest_1.describe)('version 6 to version 7', () => {
    (0, vitest_1.it)(`returns a new object`, () => {
        const originalInput = (0, lodash_1.cloneDeep)(initial_app_js_1.default);
        const migrated = (0, v6to7_js_1.migrate6to7)(originalInput);
        (0, vitest_1.expect)(migrated).not.toStrictEqual(originalInput);
    });
    (0, vitest_1.it)('should migrate an initial app DSL', () => {
        const migrated = (0, v6to7_js_1.migrate6to7)((0, lodash_1.cloneDeep)(initial_app_js_1.default));
        (0, vitest_1.expect)(migrated).toMatchSnapshot('initial app');
    });
    (0, vitest_1.it)('should migrate an app DSL with containers at the top level', () => {
        const migrated = (0, v6to7_js_1.migrate6to7)((0, lodash_1.cloneDeep)(with_slideouts_js_1.default));
        (0, vitest_1.expect)(migrated).toMatchSnapshot('app with slideouts');
    });
    (0, vitest_1.it)('should migrate an app DSL with main canvas children', () => {
        const migrated = (0, v6to7_js_1.migrate6to7)((0, lodash_1.cloneDeep)(with_main_canvas_children_js_1.default));
        (0, vitest_1.expect)(migrated).toMatchSnapshot('app with main canvas children');
    });
    (0, vitest_1.it)('should migrate an app DSL with widgets that have the name "page"', () => {
        const migrated = (0, v6to7_js_1.migrate6to7)((0, lodash_1.cloneDeep)(with_widgets_named_page_js_1.default));
        (0, vitest_1.expect)(migrated).toMatchSnapshot('app with widgets named "page"');
    });
    (0, vitest_1.it)('should migrate an APP with two modals', () => {
        const migrated = (0, v6to7_js_1.migrate6to7)((0, lodash_1.cloneDeep)(with_2_modals_js_1.default));
        (0, vitest_1.expect)(migrated).toMatchSnapshot('app with two modals');
    });
    (0, vitest_1.it)('should migrate an APP with a nested modal', () => {
        const migrated = (0, v6to7_js_1.migrate6to7)((0, lodash_1.cloneDeep)(nested_modal_js_1.default));
        (0, vitest_1.expect)(migrated).toMatchSnapshot('app with nested modal');
    });
    (0, vitest_1.it)('should migrate an edge case', () => {
        const migrated = (0, v6to7_js_1.migrate6to7)((0, lodash_1.cloneDeep)(slideout_without_child_js_1.default));
        (0, vitest_1.expect)(migrated.children?.[0].children?.[0].children?.[0].type).toBe('SLIDEOUT_WIDGET');
        (0, vitest_1.expect)(migrated.children?.[0].children?.[0].children?.[0].children?.[0]).toMatchObject({ type: 'SECTION_WIDGET' });
    });
});
//# sourceMappingURL=v6to7.test.js.map