1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Simplify a test

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>

Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
Iku-turso 2022-10-04 16:27:40 +03:00 committed by Janne Savolainen
parent 3d35ba5c24
commit 3add4255cf
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

@ -2,7 +2,6 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import type { DiContainer } from "@ogre-tools/injectable";
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
import populateApplicationMenuInjectable from "./main/populate-application-menu.injectable"; import populateApplicationMenuInjectable from "./main/populate-application-menu.injectable";
@ -10,7 +9,6 @@ import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-t
describe("application-menu", () => { describe("application-menu", () => {
let builder: ApplicationBuilder; let builder: ApplicationBuilder;
let mainDi: DiContainer;
let populateApplicationMenuMock: jest.Mock; let populateApplicationMenuMock: jest.Mock;
beforeEach(async () => { beforeEach(async () => {
@ -21,13 +19,13 @@ describe("application-menu", () => {
builder = getApplicationBuilder(); builder = getApplicationBuilder();
builder.beforeApplicationStart((mainDi) => { builder.beforeApplicationStart((mainDi) => {
mainDi.override(populateApplicationMenuInjectable, () => populateApplicationMenuMock); mainDi.override(
populateApplicationMenuInjectable,
() => populateApplicationMenuMock,
);
}); });
// await builder.render();
await builder.startHidden(); await builder.startHidden();
mainDi = builder.mainDi;
}); });
it("when insufficient time passes, does not populate menu items yet", () => { it("when insufficient time passes, does not populate menu items yet", () => {
@ -42,7 +40,9 @@ describe("application-menu", () => {
}); });
it("populates application menu", () => { it("populates application menu", () => {
expect(populateApplicationMenuMock).toHaveBeenCalledWith(expect.any(Array)); expect(populateApplicationMenuMock).toHaveBeenCalledWith(
expect.any(Array),
);
}); });
it("populates application menu lol", () => { it("populates application menu lol", () => {