From f3c77afff15256431892df3e6d6aec2be74f0c4d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 18 Jun 2026 14:17:13 +0300 Subject: [PATCH] fix? --- test/unit/specs/stores/lists.spec.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/test/unit/specs/stores/lists.spec.js b/test/unit/specs/stores/lists.spec.js index dd900dabd..cf8866541 100644 --- a/test/unit/specs/stores/lists.spec.js +++ b/test/unit/specs/stores/lists.spec.js @@ -1,10 +1,22 @@ -import { createPinia, setActivePinia } from 'pinia' -import { createStore } from 'vuex' +import { createTestingPinia } from '@pinia/testing' +import { HttpResponse, http } from 'msw' +import { setActivePinia } from 'pinia' + +import { injectMswToTest } from '/test/fixtures/mock_api.js' import { useListsStore } from 'src/stores/lists.js' -setActivePinia(createPinia()) +setActivePinia(createTestingPinia({ stubActions: false })) const store = useListsStore() +const it = injectMswToTest([ + http.get('/api/v1/lists/:id', () => HttpResponse.json({ ok: true })), + http.put('/api/v1/lists/:id', () => HttpResponse.json({ ok: true })), + http.post('/api/v1/lists/:id', () => HttpResponse.json({ ok: true })), + http.delete('/api/v1/lists/:id', () => HttpResponse.json({ ok: true })), + http.get('/api/v1/lists/:id/accounts', () => HttpResponse.json({ ok: true })), + http.post('/api/v1/lists/:id/accounts', () => HttpResponse.json({ ok: true })), + http.delete('/api/v1/lists/:id/accounts', () => HttpResponse.json({ ok: true })), +]) describe('The lists store', () => { describe('actions', () => {