From 50e19a59c13ebf6a8394aa440a9dfef541716e1c Mon Sep 17 00:00:00 2001 From: MartinSchuhmacher Date: Mon, 22 Jan 2024 15:51:17 +0100 Subject: [PATCH] fix structure --- ...ExternalToolLaunchState.composable.unit.ts | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/data-external-tool/ExternalToolLaunchState.composable.unit.ts b/src/components/data-external-tool/ExternalToolLaunchState.composable.unit.ts index d3cef5cd04..3e2515b544 100644 --- a/src/components/data-external-tool/ExternalToolLaunchState.composable.unit.ts +++ b/src/components/data-external-tool/ExternalToolLaunchState.composable.unit.ts @@ -13,6 +13,14 @@ import { useExternalToolLaunchState } from "./ExternalToolLaunchState.composable jest.mock("@data-external-tool/ExternalToolApi.composable"); +Object.defineProperty(window, "location", { + configurable: true, + writable: false, + value: { + href: "", + }, +}); + describe("ExternalToolLaunchState.composable", () => { let useExternalToolApiMock: DeepMocked>; @@ -25,13 +33,7 @@ describe("ExternalToolLaunchState.composable", () => { afterEach(() => { jest.clearAllMocks(); - Object.defineProperty(window, "location", { - configurable: true, - writable: false, - value: { - href: "", - }, - }); + window.location.href = ""; }); describe("fetchLaunchRequest", () => { @@ -238,10 +240,6 @@ describe("ExternalToolLaunchState.composable", () => { }); describe("when the launch method is unknown", () => { - beforeEach(() => { - window.location.href = ""; - }); - const setup = () => { const launchRequest = toolLaunchRequestFactory.build({ method: "unknown" as unknown as ToolLaunchRequestMethodEnum,