package electrosphere.renderer.ui.elements;

import annotations.IntegrationTest;
import electrosphere.menu.WindowUtils;
import electrosphere.menu.mainmenu.MenuGeneratorsUITesting;
import template.RenderingTestTemplate;
import testutils.TestEngineUtils;

/**
 * Tests for the window class
 */
public class WindowTest extends RenderingTestTemplate {

    /**
     * Tests creating a window
     */
    @IntegrationTest
    public void testCreateWindow(){
        //create ui testing window
        TestEngineUtils.simulateFrames(1);
        WindowUtils.replaceMainMenuContents(MenuGeneratorsUITesting.createUITestMenu());

        //only simulating 1 frame after updating ui contents does not trigger re-render in local dev environment, but DOES in CI env
        //2 frames seems to fix this
        TestEngineUtils.simulateFrames(60);
        // TestRenderingUtils.saveTestRender("./test/java/electrosphere/renderer/ui/elements/window.png");
        this.checkRender("Basic", "./test/java/electrosphere/renderer/ui/elements/window.png");
    }

}
