mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* fix initial hotbar not showing Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * hotbar command palette + switching Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * lint fix Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * add clickable index to switcher Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fixes Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * cleanup Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * cleanup Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * refactor Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix typo Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fixes Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * remote notifications Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix add to hotbar Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * don't show remove-from-hotbar on catalog context menu Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix bad merge Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix bad merge Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix bad merge Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
35 lines
855 B
TypeScript
35 lines
855 B
TypeScript
import mockFs from "mock-fs";
|
|
import { ClusterStore } from "../cluster-store";
|
|
import { HotbarStore } from "../hotbar-store";
|
|
|
|
describe("HotbarStore", () => {
|
|
beforeEach(() => {
|
|
ClusterStore.resetInstance();
|
|
ClusterStore.createInstance();
|
|
|
|
HotbarStore.resetInstance();
|
|
mockFs({ tmp: { "lens-hotbar-store.json": "{}" } });
|
|
});
|
|
|
|
afterEach(() => {
|
|
mockFs.restore();
|
|
});
|
|
|
|
describe("load", () => {
|
|
it("loads one hotbar by default", () => {
|
|
HotbarStore.createInstance().load();
|
|
expect(HotbarStore.getInstance().hotbars.length).toEqual(1);
|
|
});
|
|
});
|
|
|
|
describe("add", () => {
|
|
it("adds a hotbar", () => {
|
|
const hotbarStore = HotbarStore.getInstanceOrCreate();
|
|
|
|
hotbarStore.load();
|
|
hotbarStore.add({ name: "hottest" });
|
|
expect(hotbarStore.hotbars.length).toEqual(2);
|
|
});
|
|
});
|
|
});
|