From 781dc36912e477aa77d0fc9c4d1b0fbd4a8b5298 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Tue, 26 Mar 2024 16:29:09 -0500 Subject: [PATCH] mock worker in jest for `ToolSearch` --- client/src/components/Panels/Common/ToolSearch.test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/components/Panels/Common/ToolSearch.test.js b/client/src/components/Panels/Common/ToolSearch.test.js index 652dfe7a6a6f..f24f6c829f59 100644 --- a/client/src/components/Panels/Common/ToolSearch.test.js +++ b/client/src/components/Panels/Common/ToolSearch.test.js @@ -1,7 +1,8 @@ import "jest-location-mock"; +import { createTestingPinia } from "@pinia/testing"; import { mount } from "@vue/test-utils"; -import { createPinia } from "pinia"; +import { useToolStore } from "stores/toolStore"; import { getLocalVue } from "tests/jest/helpers"; import VueRouter from "vue-router"; @@ -13,7 +14,9 @@ const router = new VueRouter(); describe("ToolSearch", () => { it("test tools advanced filter panel navigation", async () => { - const pinia = createPinia(); + const pinia = createTestingPinia(); + const toolStore = useToolStore(); + toolStore.searchWorker = jest.fn(); const wrapper = mount(ToolSearch, { propsData: { currentPanelView: "default",