From cc1389536e581d4ceaa0179a65ed16084a9fe6b5 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Thu, 5 Sep 2024 13:01:34 +0200 Subject: [PATCH] Fix tests --- src/common/__tests__/RebootButton.test.js | 2 +- src/testUtils/mockGlobals.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/__tests__/RebootButton.test.js b/src/common/__tests__/RebootButton.test.js index 74c5b8e..8ffb440 100644 --- a/src/common/__tests__/RebootButton.test.js +++ b/src/common/__tests__/RebootButton.test.js @@ -46,7 +46,7 @@ describe("", () => { fireEvent.click(getByText(componentContainer, "Reboot")); fireEvent.click(getByText(componentContainer, "Confirm reboot")); expect(mockAxios.post).toHaveBeenCalledWith( - "/reforis/api/reboot", + "/api/reboot", undefined, expect.anything() ); diff --git a/src/testUtils/mockGlobals.js b/src/testUtils/mockGlobals.js index f7818e3..5c5f83e 100644 --- a/src/testUtils/mockGlobals.js +++ b/src/testUtils/mockGlobals.js @@ -10,3 +10,4 @@ global._ = (str) => str; global.ngettext = (str) => str; global.babel = { format: (str) => str }; global.ForisTranslations = { locale: "en" }; +global.setImmediate = (fn) => setTimeout(fn, 0); \ No newline at end of file