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 () => {
|
||||
await app.evaluate(async ({ app }) => {
|
||||
await app.applicationMenu
|
||||
.getMenuItemById("view")
|
||||
.submenu.getMenuItemById("command-palette")
|
||||
.click();
|
||||
?.getMenuItemById("view")
|
||||
?.submenu?.getMenuItemById("command-palette")
|
||||
?.click();
|
||||
});
|
||||
await window.waitForSelector(".Select__option >> text=Hotbar: Switch");
|
||||
}, 10*60*1000);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import assert from "assert";
|
||||
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";
|
||||
|
||||
export type CreateTerminalApi = (query: TerminalApiQuery) => TerminalApi;
|
||||
@ -15,13 +15,13 @@ const createTerminalApiInjectable = getInjectable({
|
||||
instantiate: (di): CreateTerminalApi => {
|
||||
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 = {
|
||||
hostedClusterId,
|
||||
return new TerminalApi({
|
||||
hostedClusterId,
|
||||
}, query);
|
||||
};
|
||||
|
||||
return (query) => new TerminalApi(dependencies, query);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -5,23 +5,25 @@
|
||||
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import createStoresAndApisInjectable from "../../create-stores-apis.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";
|
||||
|
||||
const customResourceDefinitionsInjectable = getInjectable({
|
||||
id: "custom-resource-definitions",
|
||||
|
||||
instantiate: (di) => {
|
||||
const currentlyInClusterFrame = di.inject(currentlyInClusterFrameInjectable);
|
||||
const store = di.inject(customResourceDefinitionStoreInjectable);
|
||||
const createStoresAndApis = di.inject(createStoresAndApisInjectable);
|
||||
|
||||
if (currentlyInClusterFrame) {
|
||||
const subscribeStores = di.inject(subscribeStoresInjectable);
|
||||
|
||||
subscribeStores([store]);
|
||||
if (!createStoresAndApis) {
|
||||
return computed(() => []);
|
||||
}
|
||||
|
||||
const store = di.inject(customResourceDefinitionStoreInjectable);
|
||||
const subscribeStores = di.inject(subscribeStoresInjectable);
|
||||
|
||||
subscribeStores([store]);
|
||||
|
||||
return computed(() => [...store.items]);
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user