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';
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();
});