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

Fix tests and snapshots

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-03-20 14:31:33 -04:00
parent a446a25f8f
commit 34dafcd675
36 changed files with 175 additions and 172 deletions

View File

@ -5,6 +5,7 @@
import type { ExtensionLoader } from "../extension-loader"; import type { ExtensionLoader } from "../extension-loader";
import extensionLoaderInjectable from "../extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../extension-loader/extension-loader.injectable";
import type { ObservableMap } from "mobx";
import { runInAction } from "mobx"; import { runInAction } from "mobx";
import { delay } from "@k8slens/utilities"; import { delay } from "@k8slens/utilities";
import { getDiForUnitTesting } from "../../renderer/getDiForUnitTesting"; import { getDiForUnitTesting } from "../../renderer/getDiForUnitTesting";
@ -12,7 +13,8 @@ import ipcRendererInjectable from "../../renderer/utils/channel/ipc-renderer.inj
import type { IpcRenderer } from "electron"; import type { IpcRenderer } from "electron";
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 currentlyInClusterFrameInjectable from "../../renderer/routes/currently-in-cluster-frame.injectable"; import currentlyInClusterFrameInjectable from "../../renderer/routes/currently-in-cluster-frame.injectable";
import updateExtensionsStateInjectable from "../../features/extensions/enabled/common/update-state.injectable"; import type { LensExtensionState } from "../../features/extensions/enabled/common/state.injectable";
import enabledExtensionsStateInjectable from "../../features/extensions/enabled/common/state.injectable";
const manifestPath = "manifest/path"; const manifestPath = "manifest/path";
const manifestPath2 = "manifest/path2"; const manifestPath2 = "manifest/path2";
@ -20,7 +22,7 @@ const manifestPath3 = "manifest/path3";
describe("ExtensionLoader", () => { describe("ExtensionLoader", () => {
let extensionLoader: ExtensionLoader; let extensionLoader: ExtensionLoader;
let updateExtensionStateMock: jest.Mock; let enabledExtensionsState: ObservableMap<string, LensExtensionState>;
beforeEach(() => { beforeEach(() => {
const di = getDiForUnitTesting(); const di = getDiForUnitTesting();
@ -106,11 +108,8 @@ describe("ExtensionLoader", () => {
}, },
}) as unknown as IpcRenderer); }) as unknown as IpcRenderer);
updateExtensionStateMock = jest.fn();
di.override(updateExtensionsStateInjectable, () => updateExtensionStateMock);
extensionLoader = di.inject(extensionLoaderInjectable); extensionLoader = di.inject(extensionLoaderInjectable);
enabledExtensionsState = di.inject(enabledExtensionsStateInjectable);
}); });
it("renderer updates extension after ipc broadcast", async () => { it("renderer updates extension after ipc broadcast", async () => {
@ -151,24 +150,18 @@ describe("ExtensionLoader", () => {
it("updates ExtensionsStore after isEnabled is changed", async () => { it("updates ExtensionsStore after isEnabled is changed", async () => {
await extensionLoader.init(); await extensionLoader.init();
expect(updateExtensionStateMock).not.toHaveBeenCalled();
runInAction(() => { runInAction(() => {
extensionLoader.setIsEnabled("manifest/path", false); extensionLoader.setIsEnabled("manifest/path", false);
}); });
expect(updateExtensionStateMock).toHaveBeenCalledWith( expect(enabledExtensionsState.size).toBe(2);
expect.objectContaining({ expect(enabledExtensionsState.get("manifest/path")).toMatchObject({
"manifest/path": { enabled: false,
enabled: false, name: "TestExtension",
name: "TestExtension", });
}, expect(enabledExtensionsState.get("manifest/path2")).toMatchObject({
enabled: true,
"manifest/path2": { name: "TestExtension2",
enabled: true, });
name: "TestExtension2",
},
}),
);
}); });
}); });

View File

@ -230,7 +230,7 @@ exports[`extension special characters in page registrations renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -434,7 +434,7 @@ exports[`extension special characters in page registrations when navigating to r
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -230,7 +230,7 @@ exports[`navigate to extension page renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -434,7 +434,7 @@ exports[`navigate to extension page when extension navigates to child route rend
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -654,7 +654,7 @@ exports[`navigate to extension page when extension navigates to route with param
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -874,7 +874,7 @@ exports[`navigate to extension page when extension navigates to route without pa
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1094,7 +1094,7 @@ exports[`navigate to extension page when extension navigates to route without pa
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -154,7 +154,7 @@ exports[`navigating between routes given route with optional path parameters whe
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -358,7 +358,7 @@ exports[`navigating between routes given route without path parameters when navi
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -230,7 +230,7 @@ exports[`add-cluster - navigation using application menu renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -518,7 +518,7 @@ exports[`add-cluster - navigation using application menu when navigating to add
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -231,7 +231,7 @@ exports[`installing update when started renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -516,7 +516,7 @@ exports[`installing update when started when user checks for updates renders 1`]
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -801,7 +801,7 @@ exports[`installing update when started when user checks for updates when new up
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1086,7 +1086,7 @@ exports[`installing update when started when user checks for updates when new up
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1396,7 +1396,7 @@ exports[`installing update when started when user checks for updates when new up
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1706,7 +1706,7 @@ exports[`installing update when started when user checks for updates when new up
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2016,7 +2016,7 @@ exports[`installing update when started when user checks for updates when new up
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2301,7 +2301,7 @@ exports[`installing update when started when user checks for updates when no new
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -256,7 +256,7 @@ exports[`encourage user to update when sufficient time passed since update was d
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -541,7 +541,7 @@ exports[`encourage user to update when sufficient time passed since update was d
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -231,7 +231,7 @@ exports[`installing update using tray when started renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -516,7 +516,7 @@ exports[`installing update using tray when started when user checks for updates
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -801,7 +801,7 @@ exports[`installing update using tray when started when user checks for updates
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1086,7 +1086,7 @@ exports[`installing update using tray when started when user checks for updates
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1396,7 +1396,7 @@ exports[`installing update using tray when started when user checks for updates
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1681,7 +1681,7 @@ exports[`installing update using tray when started when user checks for updates
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -256,7 +256,7 @@ exports[`force user to update when too long since update was downloaded when app
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -566,7 +566,7 @@ exports[`force user to update when too long since update was downloaded when app
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -923,7 +923,7 @@ exports[`force user to update when too long since update was downloaded when app
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -231,7 +231,7 @@ exports[`periodical checking of updates given updater is enabled and configurati
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -662,7 +662,7 @@ exports[`entity running technical tests when navigated to catalog renders 1`] =
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1378,7 +1378,7 @@ exports[`entity running technical tests when navigated to catalog when details p
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -542,7 +542,7 @@ exports[`Deleting a cluster when an internal kubeconfig cluster is used when the
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1194,7 +1194,7 @@ exports[`Deleting a cluster when the kubeconfig has multiple clusters when the d
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1879,7 +1879,7 @@ exports[`Deleting a cluster when the kubeconfig has multiple clusters when the d
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2643,7 +2643,7 @@ exports[`Deleting a cluster when the kubeconfig has multiple clusters when the d
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -3407,7 +3407,7 @@ exports[`Deleting a cluster when the kubeconfig has only one cluster when the di
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -322,7 +322,7 @@ exports[`Command Pallet: keyboard shortcut tests when on linux renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -698,7 +698,7 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing ESC
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1074,7 +1074,7 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing SHI
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1462,7 +1462,7 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing SHI
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1747,7 +1747,7 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2032,7 +2032,7 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing ESC
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2317,7 +2317,7 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing SHI
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2614,7 +2614,7 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing SHI
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -230,7 +230,7 @@ exports[`extensions - navigation using application menu renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -543,7 +543,7 @@ exports[`extensions - navigation using application menu when navigating to exten
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -649,7 +649,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1391,7 +1391,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2133,7 +2133,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2986,7 +2986,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -3736,7 +3736,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -4589,7 +4589,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -5624,7 +5624,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -6477,7 +6477,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -7512,7 +7512,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -8366,7 +8366,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -9105,7 +9105,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -9844,7 +9844,7 @@ exports[`add custom helm repository in preferences when navigating to preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -649,7 +649,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1391,7 +1391,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2135,7 +2135,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2928,7 +2928,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -3670,7 +3670,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -4401,7 +4401,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -5177,7 +5177,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -5955,7 +5955,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -6792,7 +6792,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -7523,7 +7523,7 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -649,7 +649,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1380,7 +1380,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2003,7 +2003,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2734,7 +2734,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -3357,7 +3357,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -4088,7 +4088,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -4864,7 +4864,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -5487,7 +5487,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -6110,7 +6110,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -6733,7 +6733,7 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -649,7 +649,7 @@ exports[`remove helm repository from list of active repositories in preferences
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1363,7 +1363,7 @@ exports[`remove helm repository from list of active repositories in preferences
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2077,7 +2077,7 @@ exports[`remove helm repository from list of active repositories in preferences
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2808,7 +2808,7 @@ exports[`remove helm repository from list of active repositories in preferences
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -709,7 +709,7 @@ exports[`preferences - closing-preferences given accessing preferences directly
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1057,7 +1057,7 @@ exports[`preferences - closing-preferences given accessing preferences directly
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1263,7 +1263,7 @@ exports[`preferences - closing-preferences given accessing preferences directly
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1469,7 +1469,7 @@ exports[`preferences - closing-preferences given accessing preferences directly
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2231,7 +2231,7 @@ exports[`preferences - closing-preferences given already in a page and then navi
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2579,7 +2579,7 @@ exports[`preferences - closing-preferences given already in a page and then navi
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2785,7 +2785,7 @@ exports[`preferences - closing-preferences given already in a page and then navi
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2991,7 +2991,7 @@ exports[`preferences - closing-preferences given already in a page and then navi
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -722,7 +722,7 @@ exports[`preferences: extension adding preference tabs given in preferences, whe
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -697,7 +697,7 @@ exports[`preferences - hiding-of-empty-branches, given in preferences page given
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1475,7 +1475,7 @@ exports[`preferences - hiding-of-empty-branches, given in preferences page given
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2265,7 +2265,7 @@ exports[`preferences - hiding-of-empty-branches, given in preferences page given
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -697,7 +697,7 @@ exports[`preferences - navigation to application preferences given in preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1478,7 +1478,7 @@ exports[`preferences - navigation to application preferences given in preference
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1884,7 +1884,7 @@ exports[`preferences - navigation to application preferences given in some child
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2634,7 +2634,7 @@ exports[`preferences - navigation to application preferences given in some child
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -3385,7 +3385,7 @@ exports[`preferences - navigation to application preferences given in some child
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -697,7 +697,7 @@ exports[`preferences - navigation to editor preferences given in preferences, wh
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1336,7 +1336,7 @@ exports[`preferences - navigation to editor preferences given in preferences, wh
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -710,7 +710,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1090,7 +1090,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1481,7 +1481,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1872,7 +1872,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2289,7 +2289,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -3039,7 +3039,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -3827,7 +3827,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -4232,7 +4232,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -4568,7 +4568,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -697,7 +697,7 @@ exports[`preferences - navigation to kubernetes preferences given in preferences
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1374,7 +1374,7 @@ exports[`preferences - navigation to kubernetes preferences given in preferences
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -697,7 +697,7 @@ exports[`preferences - navigation to proxy preferences given in preferences, whe
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1103,7 +1103,7 @@ exports[`preferences - navigation to proxy preferences given in preferences, whe
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -337,7 +337,7 @@ exports[`preferences - navigation to telemetry preferences given URL for Sentry
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1087,7 +1087,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1849,7 +1849,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2228,7 +2228,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -2567,7 +2567,7 @@ exports[`preferences - navigation to telemetry preferences given no URL for Sent
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -697,7 +697,7 @@ exports[`preferences - navigation to terminal preferences given in preferences,
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1310,7 +1310,7 @@ exports[`preferences - navigation to terminal preferences given in preferences,
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -230,7 +230,7 @@ exports[`preferences - navigation using application menu renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -980,7 +980,7 @@ exports[`preferences - navigation using application menu when navigating to pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -231,7 +231,7 @@ exports[`show-about-using-tray renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -983,7 +983,7 @@ exports[`show-about-using-tray when navigating using tray renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -375,7 +375,7 @@ exports[`preferences: URLs of legacy extensions given extension with both custom
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -804,7 +804,7 @@ exports[`preferences: URLs of legacy extensions given extension with both custom
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1195,7 +1195,7 @@ exports[`preferences: URLs of legacy extensions given extension with custom pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1560,7 +1560,7 @@ exports[`preferences: URLs of legacy extensions given extension with custom pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1965,7 +1965,7 @@ exports[`preferences: URLs of legacy extensions given extension with custom pref
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -231,7 +231,7 @@ exports[`status-bar-items-originating-from-extensions when application starts wh
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -231,7 +231,7 @@ exports[`extendability-using-extension-api given an extension with a weakly type
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -525,7 +525,7 @@ exports[`extendability-using-extension-api given an extension with top-bar items
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -810,7 +810,7 @@ exports[`extendability-using-extension-api given an extension with top-bar items
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1095,7 +1095,7 @@ exports[`extendability-using-extension-api renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -230,7 +230,7 @@ exports[`welcome - navigation using application menu renders 1`] = `
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -981,7 +981,7 @@ exports[`welcome - navigation using application menu when navigated somewhere el
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span
@ -1265,7 +1265,7 @@ exports[`welcome - navigation using application menu when navigated somewhere el
class="HotbarSelector" class="HotbarSelector"
> >
<i <i
class="Icon previous material interactive focusable" class="Icon material interactive focusable"
tabindex="0" tabindex="0"
> >
<span <span

View File

@ -6,7 +6,7 @@
import * as uuid from "uuid"; import * as uuid from "uuid";
import { ProtocolHandlerExtension, ProtocolHandlerInternal, ProtocolHandlerInvalid } from "../../../common/protocol-handler"; import { ProtocolHandlerExtension, ProtocolHandlerInternal, ProtocolHandlerInvalid } from "../../../common/protocol-handler";
import { delay, noop } from "@k8slens/utilities"; import { noop } from "@k8slens/utilities";
import type { LensProtocolRouterMain } from "../lens-protocol-router-main/lens-protocol-router-main"; import type { LensProtocolRouterMain } from "../lens-protocol-router-main/lens-protocol-router-main";
import { getDiForUnitTesting } from "../../getDiForUnitTesting"; import { getDiForUnitTesting } from "../../getDiForUnitTesting";
import lensProtocolRouterMainInjectable from "../lens-protocol-router-main/lens-protocol-router-main.injectable"; import lensProtocolRouterMainInjectable from "../lens-protocol-router-main/lens-protocol-router-main.injectable";
@ -91,7 +91,7 @@ describe("protocol router tests", () => {
}); });
extensionInstances.set(extId, ext); extensionInstances.set(extId, ext);
enabledExtensions.set(extId, { name: "@mirantis/minikube" }); enabledExtensions.set(extId, { name: "@mirantis/minikube", enabled: true });
lpr.addInternalHandler("/", noop); lpr.addInternalHandler("/", noop);
@ -101,14 +101,14 @@ describe("protocol router tests", () => {
expect(throwIfDefined(error)).not.toThrow(); expect(throwIfDefined(error)).not.toThrow();
} }
expect(broadcastMessageMock).toHaveBeenCalledWith(ProtocolHandlerInternal, "lens://app", "matched");
try { try {
expect(await lpr.route("lens://extension/@mirantis/minikube")).toBeUndefined(); expect(await lpr.route("lens://extension/@mirantis/minikube")).toBeUndefined();
} catch (error) { } catch (error) {
expect(throwIfDefined(error)).not.toThrow(); expect(throwIfDefined(error)).not.toThrow();
} }
await delay(50);
expect(broadcastMessageMock).toHaveBeenCalledWith(ProtocolHandlerInternal, "lens://app", "matched");
expect(broadcastMessageMock).toHaveBeenCalledWith(ProtocolHandlerExtension, "lens://extension/@mirantis/minikube", "matched"); expect(broadcastMessageMock).toHaveBeenCalledWith(ProtocolHandlerExtension, "lens://extension/@mirantis/minikube", "matched");
}); });
@ -171,7 +171,7 @@ describe("protocol router tests", () => {
}); });
extensionInstances.set(extId, ext); extensionInstances.set(extId, ext);
enabledExtensions.set(extId, { name: "@foobar/icecream" }); enabledExtensions.set(extId, { name: "@foobar/icecream", enabled: true });
try { try {
expect(await lpr.route("lens://extension/@foobar/icecream/page/foob")).toBeUndefined(); expect(await lpr.route("lens://extension/@foobar/icecream/page/foob")).toBeUndefined();
@ -179,7 +179,6 @@ describe("protocol router tests", () => {
expect(throwIfDefined(error)).not.toThrow(); expect(throwIfDefined(error)).not.toThrow();
} }
await delay(50);
expect(called).toBe("foob"); expect(called).toBe("foob");
expect(broadcastMessageMock).toBeCalledWith(ProtocolHandlerExtension, "lens://extension/@foobar/icecream/page/foob", "matched"); expect(broadcastMessageMock).toBeCalledWith(ProtocolHandlerExtension, "lens://extension/@foobar/icecream/page/foob", "matched");
}); });
@ -210,7 +209,7 @@ describe("protocol router tests", () => {
}); });
extensionInstances.set(extId, ext); extensionInstances.set(extId, ext);
enabledExtensions.set(extId, { name: "@foobar/icecream" }); enabledExtensions.set(extId, { name: "@foobar/icecream", enabled: true });
} }
{ {
@ -236,7 +235,7 @@ describe("protocol router tests", () => {
}); });
extensionInstances.set(extId, ext); extensionInstances.set(extId, ext);
enabledExtensions.set(extId, { name: "icecream" }); enabledExtensions.set(extId, { name: "icecream", enabled: true });
} }
try { try {
@ -245,7 +244,6 @@ describe("protocol router tests", () => {
expect(throwIfDefined(error)).not.toThrow(); expect(throwIfDefined(error)).not.toThrow();
} }
await delay(50);
expect(called).toBe(1); expect(called).toBe(1);
expect(broadcastMessageMock).toBeCalledWith(ProtocolHandlerExtension, "lens://extension/icecream/page", "matched"); expect(broadcastMessageMock).toBeCalledWith(ProtocolHandlerExtension, "lens://extension/icecream/page", "matched");

View File

@ -119,7 +119,13 @@ export class LensProtocolRouterMain extends proto.LensProtocolRouter {
const rawUrl = url.toString(); // for sending to renderer const rawUrl = url.toString(); // for sending to renderer
const attempt = super._routeToInternal(url); const attempt = super._routeToInternal(url);
this.disposers.push(when(() => this.rendererLoaded, () => this.dependencies.broadcastMessage(proto.ProtocolHandlerInternal, rawUrl, attempt))); const sendRoutingToRenderer = () => this.dependencies.broadcastMessage(proto.ProtocolHandlerInternal, rawUrl, attempt);
if (this.rendererLoaded) {
sendRoutingToRenderer();
} else {
this.disposers.push(when(() => this.rendererLoaded, sendRoutingToRenderer));
}
return attempt; return attempt;
} }
@ -136,7 +142,13 @@ export class LensProtocolRouterMain extends proto.LensProtocolRouter {
*/ */
const attempt = await super._routeToExtension(new URLParse(url.toString(), true)); const attempt = await super._routeToExtension(new URLParse(url.toString(), true));
this.disposers.push(when(() => this.rendererLoaded, () => this.dependencies.broadcastMessage(proto.ProtocolHandlerExtension, rawUrl, attempt))); const sendRoutingToRenderer = () => this.dependencies.broadcastMessage(proto.ProtocolHandlerExtension, rawUrl, attempt);
if (this.rendererLoaded) {
sendRoutingToRenderer();
} else {
this.disposers.push(when(() => this.rendererLoaded, sendRoutingToRenderer));
}
return attempt; return attempt;
} }