test: refs #8647 fix warning
This commit is contained in:
parent
287c61f507
commit
9961f5cda0
|
@ -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();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue