mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Replace static application window with ability to create as many as you wish Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Adapt tests for replacing static application window with ability to create as many as you wish and separate starting of main and window in behaviours Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make first render of application smaller in test that proves to be hard for CI Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove redundant code Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Simplify code Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import type { RenderResult } from "@testing-library/react";
|
|
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
|
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
|
|
|
describe("preferences - navigation to editor preferences", () => {
|
|
let applicationBuilder: ApplicationBuilder;
|
|
|
|
beforeEach(() => {
|
|
applicationBuilder = getApplicationBuilder();
|
|
});
|
|
|
|
describe("given in preferences, when rendered", () => {
|
|
let rendered: RenderResult;
|
|
|
|
beforeEach(async () => {
|
|
applicationBuilder.beforeWindowStart(() => {
|
|
applicationBuilder.preferences.navigate();
|
|
});
|
|
|
|
rendered = await applicationBuilder.render();
|
|
});
|
|
|
|
it("renders", () => {
|
|
expect(rendered.container).toMatchSnapshot();
|
|
});
|
|
|
|
it("does not show editor preferences yet", () => {
|
|
const page = rendered.queryByTestId("editor-preferences-page");
|
|
|
|
expect(page).toBeNull();
|
|
});
|
|
|
|
describe("when navigating to editor preferences using navigation", () => {
|
|
beforeEach(() => {
|
|
applicationBuilder.preferences.navigation.click("editor");
|
|
});
|
|
|
|
it("renders", () => {
|
|
expect(rendered.container).toMatchSnapshot();
|
|
});
|
|
|
|
it("shows editor preferences", () => {
|
|
const page = rendered.getByTestId("editor-preferences-page");
|
|
|
|
expect(page).not.toBeNull();
|
|
});
|
|
});
|
|
});
|
|
});
|