1
0
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:
lana-k
2021-03-13 16:58:18 +01:00
parent 507e978386
commit d52f822c15
2 changed files with 6 additions and 2 deletions

View File

@@ -88,13 +88,17 @@ describe('DbUploader.vue', () => {
}
const store = new Vuex.Store({ state, mutations })
// mock getting a file from user
const file = {}
sinon.stub(fu, 'getFileFromUser').resolves(file)
// mock db loading
const schema = {}
const $db = { loadDb: sinon.stub().resolves(schema) }
// mock router
const $router = { push: sinon.stub() }
const $route = { path: '/' }
const $route = { path: '/editor' }
// mount the component
const wrapper = shallowMount(DbUpload, {
@@ -103,6 +107,7 @@ describe('DbUploader.vue', () => {
})
await wrapper.find('.drop-area').trigger('click')
await $db.loadDb.returnValues[0]
expect($router.push.called).to.equal(false)
})
})

View File

@@ -46,7 +46,6 @@ describe('MainMenu.vue', () => {
})
it('Run and Save are not visible if there is no tabs', () => {
console.log('Run and Save are not visible')
const state = {
currentTab: null,
tabs: [{}],