1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

fix standart chart resize in pivot, improve performance

This commit is contained in:
lana-k
2025-04-03 22:36:50 +02:00
parent 77df3a8446
commit 3ee825defe
6 changed files with 115 additions and 22 deletions

View File

@@ -123,10 +123,8 @@ describe('Chart.vue', () => {
const newContainerWidth = initialContainerWidth * 2 || 1000
const newContainerHeight = initialContainerHeight * 2 || 2000
wrapper.find('.chart-container').wrapperElement.parentElement.style.width =
`${newContainerWidth}px`
wrapper.find('.chart-container').wrapperElement.parentElement.style.height =
`${newContainerHeight}px`
container.style.width = `${newContainerWidth}px`
container.style.height = `${newContainerHeight}px`
await flushPromises()
@@ -179,4 +177,34 @@ describe('Chart.vue', () => {
expect(fIo.downloadFromUrl.calledOnceWith(url, 'chart'))
wrapper.unmount()
})
it('dataSources are passed correctly', async () => {
const dataSources = {
name: ['Gryffindor'],
points: [80]
}
const wrapper = mount(Chart, {
attachTo: document.body,
props: {
dataSources
},
global: {
mocks: { $store }
}
})
await flushPromises()
await wrapper.find('button.js-add-button').wrapperElement.click()
await flushPromises()
await wrapper
.find('.field .dropdown-container .Select__indicator')
.wrapperElement.dispatchEvent(
new MouseEvent('mousedown', { bubbles: true })
)
expect(wrapper.find('.Select__menu').text()).to.contain('name' + 'points')
wrapper.unmount()
})
})