mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
import sinon
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
import sinon from 'sinon'
|
||||||
import { shallowMount, mount, createWrapper } from '@vue/test-utils'
|
import { shallowMount, mount, createWrapper } from '@vue/test-utils'
|
||||||
import { mutations } from '@/store'
|
import { mutations } from '@/store'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
@@ -248,7 +249,7 @@ describe('Tabs.vue', () => {
|
|||||||
const event = new Event('beforeunload')
|
const event = new Event('beforeunload')
|
||||||
sinon.spy(event, 'preventDefault')
|
sinon.spy(event, 'preventDefault')
|
||||||
wrapper.vm.leavingSqliteviz(event)
|
wrapper.vm.leavingSqliteviz(event)
|
||||||
|
|
||||||
expect(event.preventDefault.calledOnce).to.equal(true)
|
expect(event.preventDefault.calledOnce).to.equal(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -269,7 +270,7 @@ describe('Tabs.vue', () => {
|
|||||||
const event = new Event('beforeunload')
|
const event = new Event('beforeunload')
|
||||||
sinon.spy(event, 'preventDefault')
|
sinon.spy(event, 'preventDefault')
|
||||||
wrapper.vm.leavingSqliteviz(event)
|
wrapper.vm.leavingSqliteviz(event)
|
||||||
|
|
||||||
expect(event.preventDefault.calledOnce).to.equal(false)
|
expect(event.preventDefault.calledOnce).to.equal(false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user