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>
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
|
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
|
import getRandomIdInjectable from "../../common/utils/get-random-id.injectable";
|
|
|
|
describe("multiple separators originating from extension", () => {
|
|
let builder: ApplicationBuilder;
|
|
|
|
beforeEach(async () => {
|
|
builder = getApplicationBuilder();
|
|
|
|
builder.beforeApplicationStart((mainDi) => {
|
|
mainDi.unoverride(getRandomIdInjectable);
|
|
mainDi.permitSideEffects(getRandomIdInjectable);
|
|
});
|
|
|
|
await builder.render();
|
|
});
|
|
|
|
it("given extension with multiple separators, when extension is enabled, does not throw", () => {
|
|
const someExtension = {
|
|
id: "some-extension-id",
|
|
name: "some-extension",
|
|
|
|
mainOptions: {
|
|
trayMenus: [{ type: "separator" as const }, { type: "separator" as const } ],
|
|
},
|
|
};
|
|
|
|
expect(() => {
|
|
builder.extensions.enable(someExtension);
|
|
}).not.toThrow();
|
|
});
|
|
});
|