diff --git a/src/behaviours/application-update/__snapshots__/installing-update-using-tray.test.ts.snap b/src/behaviours/application-update/__snapshots__/installing-update-using-tray.test.ts.snap index 34fbe7daca..bb362ea546 100644 --- a/src/behaviours/application-update/__snapshots__/installing-update-using-tray.test.ts.snap +++ b/src/behaviours/application-update/__snapshots__/installing-update-using-tray.test.ts.snap @@ -628,7 +628,7 @@ exports[`installing update using tray when started when user checks for updates > - - close - - - - -
-
- - - info_outline - - -
-
-
- - Update Available - -

- Version some-version of Lens IDE is available and ready to be installed. Would you like to update now? - -Lens should restart automatically, if it doesn't please restart manually. Installed extensions might require updating. -

-
- - -
-
-
-
- { let downloadPlatformUpdateMock: AsyncFnMock; let setUpdateOnQuitMock: jest.Mock; let showInfoNotificationMock: jest.Mock; - let askBooleanMock: AsyncFnMock; beforeEach(() => { applicationBuilder = getApplicationBuilder(); @@ -38,11 +35,9 @@ describe("installing update", () => { downloadPlatformUpdateMock = asyncFn(); setUpdateOnQuitMock = jest.fn(); showInfoNotificationMock = jest.fn(() => () => {}); - askBooleanMock = asyncFn(); rendererDi.override(showInfoNotificationInjectable, () => showInfoNotificationMock); - mainDi.override(askBooleanInjectable, () => askBooleanMock); mainDi.override(setUpdateOnQuitInjectable, () => setUpdateOnQuitMock); mainDi.override( @@ -160,10 +155,6 @@ describe("installing update", () => { expect(showInfoNotificationMock).toHaveBeenCalledWith("Download of update failed"); }); - it("does not ask user to install update", () => { - expect(askBooleanMock).not.toHaveBeenCalled(); - }); - it("renders", () => { expect(rendered.baseElement).toMatchSnapshot(); }); @@ -181,43 +172,6 @@ describe("installing update", () => { it("renders", () => { expect(rendered.baseElement).toMatchSnapshot(); }); - - it("asks user to install update immediately", () => { - expect(askBooleanMock).toHaveBeenCalledWith({ - title: "Update Available", - question: - "Version some-version of Lens IDE is available and ready to be installed. Would you like to update now?\n\n" + - "Lens should restart automatically, if it doesn't please restart manually. Installed extensions might require updating.", - }); - }); - - describe("when user answers to install the update", () => { - beforeEach(async () => { - await askBooleanMock.resolve(true); - }); - - it("renders", () => { - expect(rendered.baseElement).toMatchSnapshot(); - }); - - it("quits application and installs the update", () => { - expect(quitAndInstallUpdateMock).toHaveBeenCalled(); - }); - }); - - describe("when user answers not to install the update", () => { - beforeEach(async () => { - await askBooleanMock.resolve(false); - }); - - it("renders", () => { - expect(rendered.baseElement).toMatchSnapshot(); - }); - - it("does not quit application and install the update", () => { - expect(quitAndInstallUpdateMock).not.toHaveBeenCalled(); - }); - }); }); }); }); diff --git a/src/behaviours/application-update/selection-of-update-stability.test.ts b/src/behaviours/application-update/selection-of-update-stability.test.ts index 1fd6e22dbd..c934e7fc43 100644 --- a/src/behaviours/application-update/selection-of-update-stability.test.ts +++ b/src/behaviours/application-update/selection-of-update-stability.test.ts @@ -19,8 +19,6 @@ import downloadPlatformUpdateInjectable from "../../main/application-update/down import selectedUpdateChannelInjectable from "../../common/application-update/selected-update-channel/selected-update-channel.injectable"; import type { IComputedValue } from "mobx"; import setUpdateOnQuitInjectable from "../../main/electron-app/features/set-update-on-quit.injectable"; -import type { AskBoolean } from "../../main/ask-boolean/ask-boolean.injectable"; -import askBooleanInjectable from "../../main/ask-boolean/ask-boolean.injectable"; import showInfoNotificationInjectable from "../../renderer/components/notifications/show-info-notification.injectable"; import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; import appVersionInjectable from "../../common/get-configuration-file-model/app-version/app-version.injectable"; @@ -32,7 +30,6 @@ describe("selection of update stability", () => { let downloadPlatformUpdateMock: AsyncFnMock; let setUpdateOnQuitMock: jest.Mock; let showInfoNotificationMock: jest.Mock; - let askBooleanMock: AsyncFnMock; beforeEach(() => { applicationBuilder = getApplicationBuilder(); @@ -43,11 +40,9 @@ describe("selection of update stability", () => { downloadPlatformUpdateMock = asyncFn(); setUpdateOnQuitMock = jest.fn(); showInfoNotificationMock = jest.fn(() => () => {}); - askBooleanMock = asyncFn(); rendererDi.override(showInfoNotificationInjectable, () => showInfoNotificationMock); - mainDi.override(askBooleanInjectable, () => askBooleanMock); mainDi.override(setUpdateOnQuitInjectable, () => setUpdateOnQuitMock); mainDi.override( diff --git a/src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts b/src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts index a7066468da..bd3501b5d8 100644 --- a/src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts +++ b/src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts @@ -7,21 +7,17 @@ import selectedUpdateChannelInjectable from "../../../common/application-update/ import updatesAreBeingDiscoveredInjectable from "../../../common/application-update/updates-are-being-discovered/updates-are-being-discovered.injectable"; import discoveredUpdateVersionInjectable from "../../../common/application-update/discovered-update-version/discovered-update-version.injectable"; import { runInAction } from "mobx"; -import askBooleanInjectable from "../../ask-boolean/ask-boolean.injectable"; import downloadUpdateInjectable from "../download-update/download-update.injectable"; import broadcastChangeInUpdatingStatusInjectable from "./broadcast-change-in-updating-status.injectable"; import checkForUpdatesStartingFromChannelInjectable from "./check-for-updates-starting-from-channel.injectable"; import withOrphanPromiseInjectable from "../../../common/utils/with-orphan-promise/with-orphan-promise.injectable"; import emitEventInjectable from "../../../common/app-event-bus/emit-event.injectable"; import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time"; -import quitAndInstallUpdateInjectable from "../quit-and-install-update.injectable"; const processCheckingForUpdatesInjectable = getInjectable({ id: "process-checking-for-updates", instantiate: (di) => { - const askBoolean = di.inject(askBooleanInjectable); - const quitAndInstallUpdate = di.inject(quitAndInstallUpdateInjectable); const downloadUpdate = di.inject(downloadUpdateInjectable); const selectedUpdateChannel = di.inject(selectedUpdateChannelInjectable); const broadcastChangeInUpdatingStatus = di.inject(broadcastChangeInUpdatingStatusInjectable); @@ -86,19 +82,6 @@ const processCheckingForUpdatesInjectable = getInjectable({ broadcastChangeInUpdatingStatus({ eventId: "download-for-update-failed", }); - - return; - } - - const userWantsToInstallUpdate = await askBoolean({ - title: "Update Available", - - question: `Version ${version} of Lens IDE is available and ready to be installed. Would you like to update now?\n\n` + - `Lens should restart automatically, if it doesn't please restart manually. Installed extensions might require updating.`, - }); - - if (userWantsToInstallUpdate) { - quitAndInstallUpdate(); } })(); };