From a1c9a6fa44c25a4daf5fcdcda449f4c3173c097e Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 23 Nov 2022 13:35:32 +0100 Subject: [PATCH] fix multiple view test error using pinia --- client/src/components/History/Multiple/MultipleView.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/components/History/Multiple/MultipleView.test.js b/client/src/components/History/Multiple/MultipleView.test.js index 1d68cf1f333..bafaa10556e 100644 --- a/client/src/components/History/Multiple/MultipleView.test.js +++ b/client/src/components/History/Multiple/MultipleView.test.js @@ -1,3 +1,4 @@ +import { createPinia } from "pinia"; import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { getLocalVue } from "jest/helpers"; @@ -10,6 +11,8 @@ const COUNT = 8; const USER_ID = "test-user-id"; const CURRENT_HISTORY_ID = "test-history-id-0"; +const pinia = createPinia(); + const getFakeHistorySummaries = (num, selectedIndex = 0) => { const result = Array.from({ length: num }, (_, index) => ({ id: `test-history-id-${index}`, @@ -32,6 +35,7 @@ describe("MultipleView", () => { beforeEach(async () => { wrapper = mount(MultipleView, { store, + pinia, stubs: { CurrentUser: CurrentUserMock, UserHistories: UserHistoriesMock,