"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const BaseAppState_1 = require("../../BaseApp/Entity/BaseAppState");
const ChallengeEntity_1 = require("../../Challenge/Entities/ChallengeEntity");
const ZSpaceEntity_1 = require("../../zSpace/Entities/ZSpaceEntity");
const Entities_1 = require("../Entities");
const setupStandardFramedScreen_1 = require("../Factories/setupStandardFramedScreen");
const StandardLayoutUC_1 = require("./StandardLayoutUC");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const app = appObjects.getOrCreate("App");
    const baseApp = (0, BaseAppState_1.makeBaseAppState)(app);
    baseApp.slideText = "Hello world";
    (0, ChallengeEntity_1.makeChallengeEntity)(appObjects.getOrCreate("Challenge"));
    const framedScreenAO = appObjects.getOrCreate("FramedScreen");
    const framedScreen = (0, Entities_1.makeFramedScreen)(framedScreenAO);
    mockInContainers(framedScreen);
    const zSpaceAO = appObjects.getOrCreate("zSpace");
    const zSpaceEntity = (0, ZSpaceEntity_1.makeZSpaceEntity)(zSpaceAO);
    const hook = new StandardLayoutUC_1.StandardLayoutUC(framedScreenAO);
    return { hook, baseApp, framedScreen, zSpaceEntity };
}
describe("Screen Layout Hook", () => {
    it("Calls Side by Side when narrow and consuming", () => {
        const { framedScreen, hook } = makeTestRig();
        const mockLayoutCall = jest.fn();
        hook.layoutConsumptionSideBySide = mockLayoutCall;
        const height = 1000;
        framedScreen.screenHeight = height;
        mockLayoutCall.mockClear();
        framedScreen.screenWidth = hook.consumptionSideBySideBreakWidth - 1;
        expect(mockLayoutCall).toHaveBeenCalledWith(framedScreen.screenHeight, framedScreen.screenWidth);
    });
    it("Calls Overlay when wide, consuming and the content is short", () => {
        const { framedScreen, hook, baseApp } = makeTestRig();
        const mockLayoutCall = jest.fn();
        hook.layoutConsumptionOverlay = mockLayoutCall;
        const height = 1000;
        framedScreen.screenHeight = height;
        framedScreen.screenWidth = hook.consumptionSideBySideBreakWidth;
        mockLayoutCall.mockClear();
        baseApp.slideInfoContentHeight = hook.infoContentLengthOverlayBreak;
        expect(mockLayoutCall).toHaveBeenCalledWith(framedScreen.screenHeight, framedScreen.screenWidth);
    });
    it("Calls Side by side when wide, consuming and the content is long", () => {
        const { framedScreen, hook, baseApp } = makeTestRig();
        const mockLayoutCall = jest.fn();
        hook.layoutConsumptionSideBySide = mockLayoutCall;
        const height = 1000;
        framedScreen.screenHeight = height;
        framedScreen.screenWidth = hook.consumptionSideBySideBreakWidth;
        mockLayoutCall.mockClear();
        baseApp.slideInfoContentHeight = hook.infoContentLengthOverlayBreak + 1;
        expect(mockLayoutCall).toHaveBeenCalledWith(framedScreen.screenHeight, framedScreen.screenWidth);
    });
    it("Calls Side by side when wide, consuming and the content is 0 (has not been set)", () => {
        const { framedScreen, hook, baseApp } = makeTestRig();
        const mockLayoutCall = jest.fn();
        hook.layoutConsumptionSideBySide = mockLayoutCall;
        const height = 1000;
        framedScreen.screenHeight = height;
        baseApp.slideInfoContentHeight = 0;
        mockLayoutCall.mockClear();
        framedScreen.screenWidth = hook.consumptionSideBySideBreakWidth;
        expect(mockLayoutCall).toHaveBeenCalledWith(framedScreen.screenHeight, framedScreen.screenWidth);
    });
    it("Calls Authoring when authoring", () => {
        const { framedScreen, hook, baseApp } = makeTestRig();
        const mockLayoutCall = jest.fn();
        hook.layoutForAuthoring = mockLayoutCall;
        framedScreen.screenHeight = 1000;
        framedScreen.screenWidth = 2000;
        mockLayoutCall.mockClear();
        baseApp.isAuthoring = true;
        expect(mockLayoutCall).toHaveBeenCalledWith(framedScreen.screenHeight, framedScreen.screenWidth);
    });
    it("Layout for zSpace emulation when it is set", () => {
        const { framedScreen, hook, zSpaceEntity } = makeTestRig();
        const mockLayoutCall = jest.fn();
        hook.layoutForZSpaceEmulation = mockLayoutCall;
        framedScreen.screenHeight = 1000;
        framedScreen.screenWidth = 2000;
        mockLayoutCall.mockClear();
        zSpaceEntity.emulate = true;
        expect(mockLayoutCall).toHaveBeenCalledWith(framedScreen.screenHeight, framedScreen.screenWidth);
    });
});
describe("Screen Layout Hook - Authoring Layout", () => {
    it("Sets up the slide info", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.SLIDE_INFO_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = 2000;
        hook.layoutForAuthoring(height, width);
        expect(container?.position.x).toEqual(0);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(hook.infoColumnWidth);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Sets up the toolbar", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.TOOLBAR_FRAMED_CONTAINER_ID);
        const width = 2000;
        const height = 1000;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth;
        const expectedWidth = hook.toolbarWidth;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(expectedWidth);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Sets up the render canvas", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RENDER_CANVAS_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth + hook.toolbarWidth;
        const expectedWidth = height;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(expectedWidth);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Sets up the inspector at the min size", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.INSPECTOR_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth + hook.toolbarWidth + height;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(hook.inspectorColumnWidth_Min);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Clamps the inspector at the min size", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.INSPECTOR_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height -
            100;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth + hook.toolbarWidth + height - 100;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(hook.inspectorColumnWidth_Min);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Sets up the inspector at the max size", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.INSPECTOR_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Max +
            height;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth + hook.toolbarWidth + height;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(hook.inspectorColumnWidth_Max);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Clamps the inspector at the max size", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.INSPECTOR_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Max +
            height +
            100;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth + hook.toolbarWidth + height + 100;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(hook.inspectorColumnWidth_Max);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Hides the lower letterbox if it's not needed", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LOWER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height;
        hook.layoutForAuthoring(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the upper letterbox if it's not needed", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.UPPER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height;
        hook.layoutForAuthoring(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the right letterbox if it's not needed", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RIGHT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height;
        hook.layoutForAuthoring(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the left letterbox if it's not needed", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LEFT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height;
        hook.layoutForAuthoring(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Shows the lower letterbox if too narrow", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LOWER_LETTERBOX_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height -
            100;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth + hook.toolbarWidth;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(height - 50);
        expect(container?.size.x).toEqual(height - 100);
        expect(container?.size.y).toEqual(50);
        expect(container?.show).toEqual(true);
    });
    it("Shows the upper letterbox if narrow", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.UPPER_LETTERBOX_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height -
            100;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth + hook.toolbarWidth;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(height - 100);
        expect(container?.size.y).toEqual(50);
        expect(container?.show).toEqual(true);
    });
    it("Hides the Left Letter Box if narrow", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LEFT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height -
            100;
        hook.layoutForAuthoring(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Right Letter Box if narrow", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RIGHT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Min +
            height -
            100;
        hook.layoutForAuthoring(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Shows the left letterbox if wide", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LEFT_LETTERBOX_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Max +
            height +
            100;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = hook.infoColumnWidth + hook.toolbarWidth;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(50);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Shows the right letter box if wide", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RIGHT_LETTERBOX_FRAMED_CONTAINER_ID);
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Max +
            height +
            100;
        hook.layoutForAuthoring(height, width);
        const expectedXPos = width - hook.inspectorColumnWidth_Max - 50;
        expect(container?.position.x).toEqual(expectedXPos);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(50);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Hides the upper Letter Box if narrow", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.UPPER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Max +
            height +
            100;
        hook.layoutForAuthoring(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the lower Letter Box if wide", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LOWER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const height = 1000;
        const width = hook.infoColumnWidth +
            hook.toolbarWidth +
            hook.inspectorColumnWidth_Max +
            height +
            100;
        hook.layoutForAuthoring(height, width);
        expect(container?.show).toEqual(false);
    });
});
describe("Screen Layout Hook - Side by side Consumption", () => {
    it("Sets up the slide info", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.SLIDE_INFO_FRAMED_CONTAINER_ID);
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionSideBySide(height, width);
        expect(container?.position.x).toEqual(0);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(hook.infoColumnWidth);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Sets up the toolbar", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.TOOLBAR_FRAMED_CONTAINER_ID);
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionSideBySide(height, width);
        expect(container?.position.x).toEqual(hook.infoColumnWidth);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(hook.toolbarWidth);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Hides the Upper Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.UPPER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionSideBySide(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Lower Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LOWER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionSideBySide(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Left Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LEFT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionSideBySide(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Right Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RIGHT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionSideBySide(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Sets up the render canvas", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RENDER_CANVAS_FRAMED_CONTAINER_ID);
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionSideBySide(height, width);
        const expectX = hook.infoColumnWidth + hook.toolbarWidth;
        const expectedWidth = width - expectX;
        expect(container?.position.x).toEqual(expectX);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(expectedWidth);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Hides the inspector", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.INSPECTOR_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionSideBySide(height, width);
        expect(container?.show).toEqual(false);
    });
});
describe("Screen Layout Hook - Overlay consumption", () => {
    it("Sets up the slide info", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.SLIDE_INFO_FRAMED_CONTAINER_ID);
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionOverlay(height, width);
        expect(container?.position.x).toEqual(hook.toolbarWidth + 24);
        expect(container?.position.y).toEqual(24);
        expect(container?.size.x).toEqual(264);
        expect(container?.size.y).toEqual(-1);
        expect(container?.show).toEqual(true);
    });
    it("Sets up the toolbar", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.TOOLBAR_FRAMED_CONTAINER_ID);
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionOverlay(height, width);
        expect(container?.position.x).toEqual(0);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(hook.toolbarWidth);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Sets up the render canvas", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RENDER_CANVAS_FRAMED_CONTAINER_ID);
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionOverlay(height, width);
        const expectedCanvasWidth = 2000 - hook.toolbarWidth;
        expect(container?.position.x).toEqual(hook.toolbarWidth);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(expectedCanvasWidth);
        expect(container?.size.y).toEqual(height);
        expect(container?.show).toEqual(true);
    });
    it("Hides the Upper Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.UPPER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionOverlay(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Lower Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LOWER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionOverlay(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Left Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LEFT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionOverlay(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Right Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RIGHT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionOverlay(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Inspector", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.INSPECTOR_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutConsumptionOverlay(height, width);
        expect(container?.show).toEqual(false);
    });
});
describe("Screen Layout Hook - ZSpace Emulations", () => {
    it("Hides the slide info", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.SLIDE_INFO_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutForZSpaceEmulation(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Toolbar", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.TOOLBAR_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutForZSpaceEmulation(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Sets up the render canvas to fill", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RENDER_CANVAS_FRAMED_CONTAINER_ID);
        const width = 2000;
        const height = 1000;
        hook.layoutForZSpaceEmulation(height, width);
        expect(container?.position.x).toEqual(0);
        expect(container?.position.y).toEqual(0);
        expect(container?.size.x).toEqual(2000);
        expect(container?.size.y).toEqual(1000);
        expect(container?.show).toEqual(true);
    });
    it("Hides the Upper Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.UPPER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutForZSpaceEmulation(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Lower Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LOWER_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutForZSpaceEmulation(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Left Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.LEFT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutForZSpaceEmulation(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Right Letter Box", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.RIGHT_LETTERBOX_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutForZSpaceEmulation(height, width);
        expect(container?.show).toEqual(false);
    });
    it("Hides the Inspector", () => {
        const { framedScreen, hook } = makeTestRig();
        const container = framedScreen.getContainerByID(setupStandardFramedScreen_1.INSPECTOR_FRAMED_CONTAINER_ID);
        container.show = true;
        const width = 2000;
        const height = 1000;
        hook.layoutForZSpaceEmulation(height, width);
        expect(container?.show).toEqual(false);
    });
});
function mockInContainers(framedScreen) {
    makeContainer(setupStandardFramedScreen_1.SLIDE_INFO_FRAMED_CONTAINER_ID, framedScreen);
    makeContainer(setupStandardFramedScreen_1.RENDER_CANVAS_FRAMED_CONTAINER_ID, framedScreen);
    makeContainer(setupStandardFramedScreen_1.INSPECTOR_FRAMED_CONTAINER_ID, framedScreen);
    makeContainer(setupStandardFramedScreen_1.TOOLBAR_FRAMED_CONTAINER_ID, framedScreen);
    makeContainer(setupStandardFramedScreen_1.LOWER_LETTERBOX_FRAMED_CONTAINER_ID, framedScreen);
    makeContainer(setupStandardFramedScreen_1.UPPER_LETTERBOX_FRAMED_CONTAINER_ID, framedScreen);
    makeContainer(setupStandardFramedScreen_1.LEFT_LETTERBOX_FRAMED_CONTAINER_ID, framedScreen);
    makeContainer(setupStandardFramedScreen_1.RIGHT_LETTERBOX_FRAMED_CONTAINER_ID, framedScreen);
}
function makeContainer(id, screen) {
    const ao = screen.appObject.appObjectRepo.getOrCreate(id);
    const entity = (0, Entities_1.makeFramedScreenContainer)(ao);
    screen.addContainer(entity);
    return entity;
}
//# sourceMappingURL=StandardLayoutUC.test.js.map