From 55e738f6bfc9cf06c04ee7922262a25942c3e41c Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 2 Dec 2021 15:01:02 +0100 Subject: [PATCH] update(test): remove pinia from tests * update tests to succeed with new "store" Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- cypress/integration/1-store/setElements.spec.ts | 6 ++---- cypress/integration/1-store/setState.spec.ts | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cypress/integration/1-store/setElements.spec.ts b/cypress/integration/1-store/setElements.spec.ts index 6cbd31e4..046984a4 100644 --- a/cypress/integration/1-store/setElements.spec.ts +++ b/cypress/integration/1-store/setElements.spec.ts @@ -1,11 +1,11 @@ import { getElements } from '../../../examples/Stress/utils' import { useStore } from '~/composables' -import { FlowStore } from '~/types' +import { Elements, FlowStore } from '~/types' import { isGraphEdge, isGraphNode } from '~/utils' describe('test store action setElements', () => { const setElements = async (store: FlowStore) => { - const elements = [ + const elements: Elements = [ { id: '1', type: 'input', data: { label: 'Node 1' }, position: { x: 250, y: 5 } }, { id: '2', data: { label: 'Node 2' }, position: { x: 100, y: 100 } }, { id: 'e1-2', source: '1', target: '2', animated: true }, @@ -17,7 +17,6 @@ describe('test store action setElements', () => { const store = useStore() await setElements(store) expect(store.elements).to.have.length(3) - store.$dispose() }) context('elements pre-set', () => { @@ -26,7 +25,6 @@ describe('test store action setElements', () => { store = useStore() await setElements(store) }) - afterEach(() => store.$dispose()) it('adds elements', () => { store.addElements([{ id: '4', data: { label: 'Node 4' }, position: { x: 500, y: 500 } }]) diff --git a/cypress/integration/1-store/setState.spec.ts b/cypress/integration/1-store/setState.spec.ts index e3765e0b..e1371c44 100644 --- a/cypress/integration/1-store/setState.spec.ts +++ b/cypress/integration/1-store/setState.spec.ts @@ -5,15 +5,14 @@ describe('test store state', () => { let store: FlowStore beforeEach(() => (store = useStore())) - afterEach(() => store.$dispose()) it('has any initial state', () => { - expect(store.$state).to.exist + expect(store.state).to.exist }) it('has default initial state', () => { const initial = initialState() - Object.keys(store.$state).forEach((state) => { + Object.keys(store.state).forEach((state) => { const storedState = store[state] const initialVal = initial[state] expect(JSON.stringify(storedState)).to.eq(JSON.stringify(initialVal)) @@ -32,7 +31,6 @@ describe('test store state', () => { zoomOnScroll: false, }) expect(store.zoomOnScroll).to.eq(false) - store.$dispose() }) it('gets custom node types', () => {