mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
minor changes
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
import Editor from '../views/Editor'
|
import Editor from '@/views/Editor'
|
||||||
import MyQueries from '../views/MyQueries'
|
import MyQueries from '@/views/MyQueries'
|
||||||
import Home from '../views/Home'
|
import Home from '@/views/Home'
|
||||||
import MainView from '../views/MainView'
|
import MainView from '@/views/MainView'
|
||||||
|
|
||||||
Vue.use(VueRouter)
|
Vue.use(VueRouter)
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ const localVue = createLocalVue()
|
|||||||
localVue.use(Vuex)
|
localVue.use(Vuex)
|
||||||
|
|
||||||
describe('Schema.vue', () => {
|
describe('Schema.vue', () => {
|
||||||
|
afterEach(() => {
|
||||||
|
sinon.restore()
|
||||||
|
})
|
||||||
|
|
||||||
it('Renders DB name on initial', () => {
|
it('Renders DB name on initial', () => {
|
||||||
// mock store state
|
// mock store state
|
||||||
const state = {
|
const state = {
|
||||||
@@ -149,13 +153,8 @@ describe('Schema.vue', () => {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
const $db = {
|
const $db = {
|
||||||
loadDb (file) {
|
loadDb: sinon.stub().resolves(newSchema)
|
||||||
return Promise.resolve(newSchema)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// spy on $db.loadDb()
|
|
||||||
sinon.spy($db, 'loadDb')
|
|
||||||
|
|
||||||
// mount the component
|
// mount the component
|
||||||
const wrapper = mount(Schema, { store, localVue, mocks: { $db } })
|
const wrapper = mount(Schema, { store, localVue, mocks: { $db } })
|
||||||
@@ -170,8 +169,5 @@ describe('Schema.vue', () => {
|
|||||||
|
|
||||||
await $db.loadDb.returnValues[0]
|
await $db.loadDb.returnValues[0]
|
||||||
expect(mutations.saveSchema.calledOnceWith(state, newSchema)).to.equal(true)
|
expect(mutations.saveSchema.calledOnceWith(state, newSchema)).to.equal(true)
|
||||||
|
|
||||||
$db.loadDb.restore()
|
|
||||||
fu.getFileFromUser.restore()
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user