test: refs #8647 fix warning

This commit is contained in:
Javier Segarra 2025-02-28 10:40:52 +01:00
parent 287c61f507
commit 9961f5cda0
1 changed files with 12 additions and 3 deletions

View File

@ -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'; import { useStateQueryStore } from 'src/stores/useStateQueryStore';
describe('useStateQueryStore', () => { describe('useStateQueryStore', () => {
const stateQueryStore = useStateQueryStore(); let stateQueryStore;
const { add, isLoading, remove, reset } = useStateQueryStore(); let add, isLoading, remove, reset;
const firstQuery = { url: 'myQuery' }; const firstQuery = { url: 'myQuery' };
function getQueries() { function getQueries() {
return stateQueryStore.queries; return stateQueryStore.queries;
} }
beforeAll(() => {
setActivePinia(createPinia());
});
beforeEach(() => { beforeEach(() => {
stateQueryStore = useStateQueryStore();
({ add, isLoading, remove, reset } = useStateQueryStore());
reset(); reset();
// setActivePinia(createPinia());
expect(getQueries().size).toBeFalsy(); expect(getQueries().size).toBeFalsy();
}); });