1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00
This commit is contained in:
lana-k
2025-01-12 22:00:48 +01:00
parent f55a8caa92
commit 108d96a753
9 changed files with 63 additions and 62 deletions

View File

@@ -31,7 +31,6 @@ describe('App.vue', () => {
]) ])
sinon.spy(storedInquiries, 'updateStorage') sinon.spy(storedInquiries, 'updateStorage')
const state = { const state = {
predefinedInquiries: [], predefinedInquiries: [],
inquiries: [] inquiries: []
@@ -45,7 +44,9 @@ describe('App.vue', () => {
expect(storedInquiries.updateStorage.calledTwice).to.equal(true) expect(storedInquiries.updateStorage.calledTwice).to.equal(true)
expect(storedInquiries.updateStorage.args[1][0]).to.eql([ expect(storedInquiries.updateStorage.args[1][0]).to.eql([
{id: 1, name: 'new foo name'}, {id: 2, name: 'baz'}, {id: 3, name: 'bar'} { id: 1, name: 'new foo name' },
{ id: 2, name: 'baz' },
{ id: 3, name: 'bar' }
]) ])
}) })
}) })

View File

@@ -1,5 +1,6 @@
import { expect } from 'chai' import { expect } from 'chai'
import actions from '@/store/actions' import actions from '@/store/actions'
import sinon from 'sinon'
const { const {
addTab, addTab,
@@ -114,7 +115,7 @@ describe('actions', () => {
inquiries: [ inquiries: [
{ id: 1, name: 'foo' }, { id: 1, name: 'foo' },
{ id: 2, name: 'bar' }, { id: 2, name: 'bar' },
{ id: 3, name: 'baz' }, { id: 3, name: 'baz' }
], ],
tabs: [{ id: 1, name: 'foo' }, { id: 2, name: 'bar' }] tabs: [{ id: 1, name: 'foo' }, { id: 2, name: 'bar' }]
} }
@@ -124,7 +125,7 @@ describe('actions', () => {
expect(state.inquiries).to.eql([ expect(state.inquiries).to.eql([
{ id: 1, name: 'foo' }, { id: 1, name: 'foo' },
{ id: 2, name: 'new name' }, { id: 2, name: 'new name' },
{ id: 3, name: 'baz' }, { id: 3, name: 'baz' }
]) ])
expect(commit.calledWith('updateTab', { expect(commit.calledWith('updateTab', {
tab: { id: 2, name: 'bar' }, tab: { id: 2, name: 'bar' },
@@ -152,7 +153,7 @@ describe('actions', () => {
} }
const state = { const state = {
inquiries: [], inquiries: [],
tabs: [tab], tabs: [tab]
} }
const value = await saveInquiry({ state }, { const value = await saveInquiry({ state }, {
@@ -183,7 +184,7 @@ describe('actions', () => {
const state = { const state = {
inquiries: [], inquiries: [],
tabs: [tab], tabs: [tab]
} }
const first = await saveInquiry({ state }, { const first = await saveInquiry({ state }, {
@@ -223,7 +224,7 @@ describe('actions', () => {
const state = { const state = {
inquiries: [], inquiries: [],
tabs: [tab], tabs: [tab]
} }
await saveInquiry({ state }, { await saveInquiry({ state }, {

View File

@@ -362,7 +362,6 @@ describe('MainMenu.vue', () => {
const $route = { path: '/workspace' } const $route = { path: '/workspace' }
sinon.stub(storedInquiries, 'isTabNeedName').returns(false) sinon.stub(storedInquiries, 'isTabNeedName').returns(false)
wrapper = mount(MainMenu, { wrapper = mount(MainMenu, {
store, store,
mocks: { $route }, mocks: { $route },