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

Pass quitAndInstallUpdateInjectable to UpdateButton

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-06-09 12:10:40 +03:00
parent 3207a6f057
commit f67d862679
2 changed files with 4 additions and 5 deletions

View File

@ -12,8 +12,8 @@ import appUpdateWarningLevelInjectable from "../../../app-update-warning/app-upd
import { computed } from "mobx";
import type { DiRender } from "../../test-utils/renderFor";
import { renderFor } from "../../test-utils/renderFor";
import updateAppInjectable from "../update-app.injectable";
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
import quitAndInstallUpdateInjectable from "../../../../main/electron-app/features/quit-and-install-update.injectable";
describe("<UpdateButton/>", () => {
let di: DiContainer;
@ -22,7 +22,6 @@ describe("<UpdateButton/>", () => {
beforeEach(() => {
di = getDiForUnitTesting({ doGeneralOverrides: true });
di.override(updateAppInjectable, jest.fn);
di.override(appUpdateWarningLevelInjectable, () => computed(() => ""));
render = renderFor(di);
@ -58,7 +57,7 @@ describe("<UpdateButton/>", () => {
const update = jest.fn();
di.override(appUpdateWarningLevelInjectable, () => computed(() => "light"));
di.override(updateAppInjectable, update);
di.override(quitAndInstallUpdateInjectable, update);
const { getByTestId } = render(<UpdateButton />);

View File

@ -15,7 +15,7 @@ import { withInjectables } from "@ogre-tools/injectable-react";
import { observer } from "mobx-react";
import appUpdateWarningLevelInjectable from "../../app-update-warning/app-update-warning-level.injectable";
import type { IComputedValue } from "mobx";
import updateAppInjectable from "./update-app.injectable";
import quitAndInstallUpdateInjectable from "../../../main/electron-app/features/quit-and-install-update.injectable";
interface UpdateButtonProps extends HTMLAttributes<HTMLButtonElement> {
}
@ -76,7 +76,7 @@ export const UpdateButton = withInjectables<Dependencies, UpdateButtonProps>(Non
return {
...props,
warningLevel: di.inject(appUpdateWarningLevelInjectable),
update: di.inject(updateAppInjectable),
update: di.inject(quitAndInstallUpdateInjectable),
};
},
});