mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove use of mockFs in hotbar remove command tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
873d9bb926
commit
bbcdd89009
@ -13,9 +13,7 @@ import type { DiRender } from "../../test-utils/renderFor";
|
|||||||
import { renderFor } from "../../test-utils/renderFor";
|
import { renderFor } from "../../test-utils/renderFor";
|
||||||
import hotbarStoreInjectable from "../../../../common/hotbars/store.injectable";
|
import hotbarStoreInjectable from "../../../../common/hotbars/store.injectable";
|
||||||
import { ConfirmDialog } from "../../confirm-dialog";
|
import { ConfirmDialog } from "../../confirm-dialog";
|
||||||
import mockFs from "mock-fs";
|
|
||||||
import directoryForUserDataInjectable from "../../../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable";
|
import directoryForUserDataInjectable from "../../../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable";
|
||||||
import getConfigurationFileModelInjectable from "../../../../common/get-configuration-file-model/get-configuration-file-model.injectable";
|
|
||||||
import type { HotbarStore } from "../../../../common/hotbars/store";
|
import type { HotbarStore } from "../../../../common/hotbars/store";
|
||||||
import storesAndApisCanBeCreatedInjectable from "../../../stores-apis-can-be-created.injectable";
|
import storesAndApisCanBeCreatedInjectable from "../../../stores-apis-can-be-created.injectable";
|
||||||
|
|
||||||
@ -27,13 +25,6 @@ const mockHotbars: Partial<Record<string, any>> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
jest.mock("electron", () => ({
|
|
||||||
ipcRenderer: {
|
|
||||||
on: jest.fn(),
|
|
||||||
invoke: jest.fn(),
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
describe("<HotbarRemoveCommand />", () => {
|
describe("<HotbarRemoveCommand />", () => {
|
||||||
let di: DiContainer;
|
let di: DiContainer;
|
||||||
let render: DiRender;
|
let render: DiRender;
|
||||||
@ -41,21 +32,12 @@ describe("<HotbarRemoveCommand />", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
di = getDiForUnitTesting({ doGeneralOverrides: true });
|
di = getDiForUnitTesting({ doGeneralOverrides: true });
|
||||||
|
|
||||||
mockFs();
|
|
||||||
|
|
||||||
di.override(storesAndApisCanBeCreatedInjectable, () => true);
|
di.override(storesAndApisCanBeCreatedInjectable, () => true);
|
||||||
di.override(directoryForUserDataInjectable, () => "some-directory-for-user-data");
|
di.override(directoryForUserDataInjectable, () => "/some-directory-for-user-data");
|
||||||
|
|
||||||
di.permitSideEffects(hotbarStoreInjectable);
|
|
||||||
di.permitSideEffects(getConfigurationFileModelInjectable);
|
|
||||||
|
|
||||||
render = renderFor(di);
|
render = renderFor(di);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
mockFs.restore();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("renders w/o errors", () => {
|
it("renders w/o errors", () => {
|
||||||
di.override(hotbarStoreInjectable, () => ({
|
di.override(hotbarStoreInjectable, () => ({
|
||||||
hotbars: [mockHotbars["1"]],
|
hotbars: [mockHotbars["1"]],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user