From 7c5bc03be98e171a4a8c8b6d75bdb0b85c59d423 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 11 May 2021 09:01:15 -0400 Subject: [PATCH] fix unit test Signed-off-by: Sebastian Malton --- .../protocol-handler/__test__/router.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/protocol-handler/__test__/router.test.ts b/src/main/protocol-handler/__test__/router.test.ts index 408fde02aa..750ccef7cc 100644 --- a/src/main/protocol-handler/__test__/router.test.ts +++ b/src/main/protocol-handler/__test__/router.test.ts @@ -1,11 +1,12 @@ -import { LensProtocolRouterMain } from "../router"; -import { noop } from "../../../common/utils"; -import { ExtensionsStore } from "../../../extensions/extensions-store"; -import { ExtensionLoader } from "../../../extensions/extension-loader"; import * as uuid from "uuid"; -import { LensMainExtension } from "../../../extensions/core-api"; + import { broadcastMessage } from "../../../common/ipc"; import { ProtocolHandlerExtension, ProtocolHandlerInternal } from "../../../common/protocol-handler"; +import { noop } from "../../../common/utils"; +import { LensMainExtension } from "../../../extensions/core-api"; +import { ExtensionLoader } from "../../../extensions/extension-loader"; +import { ExtensionsStore } from "../../../extensions/extensions-store"; +import { LensProtocolRouterMain } from "../router"; jest.mock("../../../common/ipc"); @@ -54,7 +55,7 @@ describe("protocol router tests", () => { } }); - it("should not throw when has valid host", async () => { + it.only("should not throw when has valid host", async () => { const extId = uuid.v4(); const ext = new LensMainExtension({ id: extId, @@ -85,14 +86,13 @@ describe("protocol router tests", () => { expect(throwIfDefined(error)).not.toThrow(); } - try { expect(await lpr.route("lens://extension/@mirantis/minikube")).toBeUndefined(); } catch (error) { expect(throwIfDefined(error)).not.toThrow(); } - expect(broadcastMessage).toHaveBeenNthCalledWith(1, ProtocolHandlerInternal, "lens://app"); + expect(broadcastMessage).toHaveBeenNthCalledWith(1, ProtocolHandlerInternal, "lens://app/"); expect(broadcastMessage).toHaveBeenNthCalledWith(2, ProtocolHandlerExtension, "lens://extension/@mirantis/minikube"); });