mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix command-palette e2e test
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
bc188837a0
commit
35903c05a0
@ -24,9 +24,9 @@ describe("Lens command palette", () => {
|
|||||||
utils.itIf(!isWindows)("opens command dialog from menu", async () => {
|
utils.itIf(!isWindows)("opens command dialog from menu", async () => {
|
||||||
await app.evaluate(async ({ app }) => {
|
await app.evaluate(async ({ app }) => {
|
||||||
await app.applicationMenu
|
await app.applicationMenu
|
||||||
.getMenuItemById("view")
|
?.getMenuItemById("view")
|
||||||
.submenu.getMenuItemById("command-palette")
|
?.submenu?.getMenuItemById("command-palette")
|
||||||
.click();
|
?.click();
|
||||||
});
|
});
|
||||||
await window.waitForSelector(".Select__option >> text=Hotbar: Switch");
|
await window.waitForSelector(".Select__option >> text=Hotbar: Switch");
|
||||||
}, 10*60*1000);
|
}, 10*60*1000);
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import assert from "assert";
|
import assert from "assert";
|
||||||
import hostedClusterIdInjectable from "../../common/cluster-store/hosted-cluster-id.injectable";
|
import hostedClusterIdInjectable from "../../common/cluster-store/hosted-cluster-id.injectable";
|
||||||
import type { TerminalApiDependencies, TerminalApiQuery } from "./terminal-api";
|
import type { TerminalApiQuery } from "./terminal-api";
|
||||||
import { TerminalApi } from "./terminal-api";
|
import { TerminalApi } from "./terminal-api";
|
||||||
|
|
||||||
export type CreateTerminalApi = (query: TerminalApiQuery) => TerminalApi;
|
export type CreateTerminalApi = (query: TerminalApiQuery) => TerminalApi;
|
||||||
@ -15,13 +15,13 @@ const createTerminalApiInjectable = getInjectable({
|
|||||||
instantiate: (di): CreateTerminalApi => {
|
instantiate: (di): CreateTerminalApi => {
|
||||||
const hostedClusterId = di.inject(hostedClusterIdInjectable);
|
const hostedClusterId = di.inject(hostedClusterIdInjectable);
|
||||||
|
|
||||||
assert(hostedClusterId, "Can only create terminal APIs within a cluster frame");
|
return (query) => {
|
||||||
|
assert(hostedClusterId, "Can only create terminal APIs within a cluster frame");
|
||||||
|
|
||||||
const dependencies: TerminalApiDependencies = {
|
return new TerminalApi({
|
||||||
hostedClusterId,
|
hostedClusterId,
|
||||||
|
}, query);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (query) => new TerminalApi(dependencies, query);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -5,23 +5,25 @@
|
|||||||
|
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
|
import createStoresAndApisInjectable from "../../create-stores-apis.injectable";
|
||||||
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
|
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
|
||||||
import currentlyInClusterFrameInjectable from "../../routes/currently-in-cluster-frame.injectable";
|
|
||||||
import customResourceDefinitionStoreInjectable from "./definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "./definition.store.injectable";
|
||||||
|
|
||||||
const customResourceDefinitionsInjectable = getInjectable({
|
const customResourceDefinitionsInjectable = getInjectable({
|
||||||
id: "custom-resource-definitions",
|
id: "custom-resource-definitions",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
const currentlyInClusterFrame = di.inject(currentlyInClusterFrameInjectable);
|
const createStoresAndApis = di.inject(createStoresAndApisInjectable);
|
||||||
const store = di.inject(customResourceDefinitionStoreInjectable);
|
|
||||||
|
|
||||||
if (currentlyInClusterFrame) {
|
if (!createStoresAndApis) {
|
||||||
const subscribeStores = di.inject(subscribeStoresInjectable);
|
return computed(() => []);
|
||||||
|
|
||||||
subscribeStores([store]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const store = di.inject(customResourceDefinitionStoreInjectable);
|
||||||
|
const subscribeStores = di.inject(subscribeStoresInjectable);
|
||||||
|
|
||||||
|
subscribeStores([store]);
|
||||||
|
|
||||||
return computed(() => [...store.items]);
|
return computed(() => [...store.items]);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user