1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 02:28:54 +08:00

fix errors in tests

This commit is contained in:
lana-k
2021-09-01 22:27:51 +02:00
parent 61ffcc82d6
commit 42cce95ed0
4 changed files with 26 additions and 8 deletions

View File

@@ -2,8 +2,12 @@ import { expect } from 'chai'
import { mount } from '@vue/test-utils'
import Pivot from '@/views/Main/Workspace/Tabs/Tab/DataView/Pivot'
import $ from 'jquery'
import sinon from 'sinon'
describe('Pivot.vue', () => {
afterEach(() => {
sinon.restore()
})
it('renders pivot table', () => {
const wrapper = mount(Pivot, {
propsData: {
@@ -191,6 +195,7 @@ describe('Pivot.vue', () => {
rendererName: 'Custom chart',
rendererOptions: {
customChartComponent: {
$mount: sinon.stub(),
getOptionsForSave () {
return { here_are: 'custom chart settings' }
}

View File

@@ -231,8 +231,11 @@ describe('Tab.vue', () => {
it('Passes result to sql-table component', async () => {
const result = {
id: [1, 2],
name: ['foo', 'bar']
columns: ['id', 'name'],
values: {
id: [1, 2],
name: ['foo', 'bar']
}
}
// mock store state
const state = {
@@ -269,8 +272,11 @@ describe('Tab.vue', () => {
it('Updates schema after query execution', async () => {
const result = {
id: [],
name: []
columns: ['id', 'name'],
values: {
id: [],
name: []
}
}
// mock store state