mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
fix main menu test
This commit is contained in:
@@ -88,13 +88,17 @@ describe('DbUploader.vue', () => {
|
|||||||
}
|
}
|
||||||
const store = new Vuex.Store({ state, mutations })
|
const store = new Vuex.Store({ state, mutations })
|
||||||
|
|
||||||
|
// mock getting a file from user
|
||||||
|
const file = {}
|
||||||
|
sinon.stub(fu, 'getFileFromUser').resolves(file)
|
||||||
|
|
||||||
// mock db loading
|
// mock db loading
|
||||||
const schema = {}
|
const schema = {}
|
||||||
const $db = { loadDb: sinon.stub().resolves(schema) }
|
const $db = { loadDb: sinon.stub().resolves(schema) }
|
||||||
|
|
||||||
// mock router
|
// mock router
|
||||||
const $router = { push: sinon.stub() }
|
const $router = { push: sinon.stub() }
|
||||||
const $route = { path: '/' }
|
const $route = { path: '/editor' }
|
||||||
|
|
||||||
// mount the component
|
// mount the component
|
||||||
const wrapper = shallowMount(DbUpload, {
|
const wrapper = shallowMount(DbUpload, {
|
||||||
@@ -103,6 +107,7 @@ describe('DbUploader.vue', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await wrapper.find('.drop-area').trigger('click')
|
await wrapper.find('.drop-area').trigger('click')
|
||||||
|
await $db.loadDb.returnValues[0]
|
||||||
expect($router.push.called).to.equal(false)
|
expect($router.push.called).to.equal(false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ describe('MainMenu.vue', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('Run and Save are not visible if there is no tabs', () => {
|
it('Run and Save are not visible if there is no tabs', () => {
|
||||||
console.log('Run and Save are not visible')
|
|
||||||
const state = {
|
const state = {
|
||||||
currentTab: null,
|
currentTab: null,
|
||||||
tabs: [{}],
|
tabs: [{}],
|
||||||
|
|||||||
Reference in New Issue
Block a user