From: Eduardo San Martin Morote Date: Wed, 28 Jul 2021 07:55:53 +0000 (+0200) Subject: test: add skipped test X-Git-Tag: v2.0.0-rc.0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc7f1fa0609ad4c958dfc6cb8425d6cfce0915ed;p=thirdparty%2Fvuejs%2Fpinia.git test: add skipped test --- diff --git a/__tests__/storeSetup.spec.ts b/__tests__/storeSetup.spec.ts index 24a11ef5..14d0eda7 100644 --- a/__tests__/storeSetup.spec.ts +++ b/__tests__/storeSetup.spec.ts @@ -72,6 +72,20 @@ describe('store with setup syntax', () => { expect(spy).toHaveBeenCalledTimes(1) }) + // TODO: could be fixed by using computed or getters + setters in store + it.skip('state refs can be watched', async () => { + const store = useStore() + const spy = jest.fn() + watch(() => store.name, spy) + expect(spy).not.toHaveBeenCalled() + const nameRef = ref('Ed') + store._p.state.value[store.$id].name = nameRef + // @ts-ignore + // store.$state.name = nameRef + await nextTick() + expect(spy).toHaveBeenCalledTimes(1) + }) + it('unwraps refs', () => { const name = ref('Eduardo') const counter = ref(0)