diff --git a/src/stores/__tests__/useStateQueryStore.spec.js b/src/stores/__tests__/useStateQueryStore.spec.js index c7063f176..890fa855c 100644 --- a/src/stores/__tests__/useStateQueryStore.spec.js +++ b/src/stores/__tests__/useStateQueryStore.spec.js @@ -1,18 +1,27 @@ -import { describe, expect, it, beforeEach } from 'vitest'; +import { describe, expect, it, beforeEach, beforeAll } from 'vitest'; +import { setActivePinia, createPinia } from 'pinia'; import { useStateQueryStore } from 'src/stores/useStateQueryStore'; describe('useStateQueryStore', () => { - const stateQueryStore = useStateQueryStore(); - const { add, isLoading, remove, reset } = useStateQueryStore(); + let stateQueryStore; + let add, isLoading, remove, reset; const firstQuery = { url: 'myQuery' }; function getQueries() { return stateQueryStore.queries; } + beforeAll(() => { + setActivePinia(createPinia()); + }); beforeEach(() => { + stateQueryStore = useStateQueryStore(); + ({ add, isLoading, remove, reset } = useStateQueryStore()); + reset(); + + // setActivePinia(createPinia()); expect(getQueries().size).toBeFalsy(); });