mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Move disconnecting cluster connections to own runnable
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
980b054fad
commit
1581da458d
5 files changed
+24
-46
No files matched your search
-10
@@ -5,16 +5,13 @@
|
||||
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { ClusterManager } from "../../main/cluster/manager";
|
||||
import forceAppExitInjectable from "../../main/electron-app/features/force-app-exit.injectable";
|
||||
import clusterManagerInjectable from "../../main/cluster/manager.injectable";
|
||||
import stopServicesAndExitAppInjectable from "../../main/stop-services-and-exit-app.injectable";
|
||||
import { testUsingFakeTime, advanceFakeTime } from "../../test-utils/use-fake-time";
|
||||
|
||||
describe("quitting the app using application menu", () => {
|
||||
describe("given application has started", () => {
|
||||
let builder: ApplicationBuilder;
|
||||
let clusterManagerStub: ClusterManager;
|
||||
let forceAppExitMock: jest.Mock;
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -25,9 +22,6 @@ describe("quitting the app using application menu", () => {
|
||||
builder.beforeApplicationStart(({ mainDi }) => {
|
||||
mainDi.unoverride(stopServicesAndExitAppInjectable);
|
||||
|
||||
clusterManagerStub = { stop: jest.fn() } as unknown as ClusterManager;
|
||||
mainDi.override(clusterManagerInjectable, () => clusterManagerStub);
|
||||
|
||||
forceAppExitMock = jest.fn();
|
||||
mainDi.override(forceAppExitInjectable, () => forceAppExitMock);
|
||||
});
|
||||
@@ -52,10 +46,6 @@ describe("quitting the app using application menu", () => {
|
||||
expect(windows).toEqual([]);
|
||||
});
|
||||
|
||||
it("disconnects all clusters", () => {
|
||||
expect(clusterManagerStub.stop).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("after insufficient time passes, does not terminate application yet", () => {
|
||||
advanceFakeTime(999);
|
||||
|
||||
|
||||
Reference in new issue
Block a user