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:
@@ -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' }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user