fix(tests): replace useStore with useVueFlow
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { getElements } from '../../../examples/Stress/utils'
|
import { getElements } from '../../../examples/Stress/utils'
|
||||||
import { useStore } from '~/composables'
|
import { useVueFlow } from '~/composables'
|
||||||
import { Edge, FlowStore, Node } from '~/types'
|
import { Edge, FlowStore, Node } from '~/types'
|
||||||
import { isEdge, isNode } from '~/utils'
|
import { isEdge, isNode } from '~/utils'
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ describe('test store action setElements', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
it('sets elements', async () => {
|
it('sets elements', async () => {
|
||||||
const store = useStore()
|
const { store } = useVueFlow()
|
||||||
await setElements(store)
|
await setElements(store)
|
||||||
expect(store.nodes).to.have.length(2)
|
expect(store.nodes).to.have.length(2)
|
||||||
expect(store.edges).to.have.length(1)
|
expect(store.edges).to.have.length(1)
|
||||||
@@ -26,7 +26,7 @@ describe('test store action setElements', () => {
|
|||||||
context('elements pre-set', () => {
|
context('elements pre-set', () => {
|
||||||
let store: FlowStore
|
let store: FlowStore
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
store = useStore()
|
const { store } = useVueFlow()
|
||||||
await setElements(store)
|
await setElements(store)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { useStore } from '~/composables'
|
import { useVueFlow } from '~/composables'
|
||||||
import { FlowState, FlowStore } from '~/types'
|
import { FlowState, FlowStore } from '~/types'
|
||||||
import { initialState } from '~/store'
|
import { initialState } from '~/store'
|
||||||
describe('test store state', () => {
|
describe('test store state', () => {
|
||||||
let store: FlowStore
|
let store: FlowStore
|
||||||
|
|
||||||
beforeEach(() => (store = useStore()))
|
beforeEach(() => ({ store } = useVueFlow()))
|
||||||
|
|
||||||
it('has any initial state', () => {
|
it('has any initial state', () => {
|
||||||
expect(store.state).to.exist
|
expect(store.state).to.exist
|
||||||
@@ -27,7 +27,7 @@ describe('test store state', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('takes initial options', () => {
|
it('takes initial options', () => {
|
||||||
const store = useStore({
|
const { store } = useVueFlow({
|
||||||
zoomOnScroll: false,
|
zoomOnScroll: false,
|
||||||
})
|
})
|
||||||
expect(store.zoomOnScroll).to.eq(false)
|
expect(store.zoomOnScroll).to.eq(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user