diff --git a/src/router/index.js b/src/router/index.js index 7c23fac..288a074 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,9 +1,9 @@ import Vue from 'vue' import VueRouter from 'vue-router' -import Editor from '../views/Editor' -import MyQueries from '../views/MyQueries' -import Home from '../views/Home' -import MainView from '../views/MainView' +import Editor from '@/views/Editor' +import MyQueries from '@/views/MyQueries' +import Home from '@/views/Home' +import MainView from '@/views/MainView' Vue.use(VueRouter) diff --git a/tests/unit/components/Schema.spec.js b/tests/unit/components/Schema.spec.js index 8585555..b4faf1a 100644 --- a/tests/unit/components/Schema.spec.js +++ b/tests/unit/components/Schema.spec.js @@ -10,6 +10,10 @@ const localVue = createLocalVue() localVue.use(Vuex) describe('Schema.vue', () => { + afterEach(() => { + sinon.restore() + }) + it('Renders DB name on initial', () => { // mock store state const state = { @@ -149,14 +153,9 @@ describe('Schema.vue', () => { ] } const $db = { - loadDb (file) { - return Promise.resolve(newSchema) - } + loadDb: sinon.stub().resolves(newSchema) } - // spy on $db.loadDb() - sinon.spy($db, 'loadDb') - // mount the component const wrapper = mount(Schema, { store, localVue, mocks: { $db } }) @@ -170,8 +169,5 @@ describe('Schema.vue', () => { await $db.loadDb.returnValues[0] expect(mutations.saveSchema.calledOnceWith(state, newSchema)).to.equal(true) - - $db.loadDb.restore() - fu.getFileFromUser.restore() }) })