mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
add test for pivot helper
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { expect } from 'chai'
|
||||
import { _getDataSources } from '@/views/Main/Workspace/Tabs/Tab/DataView/Pivot/pivotHelper'
|
||||
import { _getDataSources, getPivotCanvas }
|
||||
from '@/views/Main/Workspace/Tabs/Tab/DataView/Pivot/pivotHelper'
|
||||
|
||||
describe('pivotHelper.js', () => {
|
||||
it('_getDataSources returns data sources', () => {
|
||||
@@ -53,4 +54,13 @@ describe('pivotHelper.js', () => {
|
||||
'y:9': [11, 12, 10, 15]
|
||||
})
|
||||
})
|
||||
|
||||
it('getPivotCanvas returns canvas', async () => {
|
||||
const pivotOutput = document.body
|
||||
const child = document.createElement('div')
|
||||
child.classList.add('pvtTable')
|
||||
pivotOutput.append(child)
|
||||
|
||||
expect(await getPivotCanvas(pivotOutput)).to.be.instanceof(HTMLCanvasElement)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user