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

fix tests

This commit is contained in:
lana-k
2025-03-09 21:57:36 +01:00
parent 828cad6439
commit b5504b91ce
48 changed files with 7871 additions and 29372 deletions

View File

@@ -1,6 +1,7 @@
import { expect } from 'chai'
import { shallowMount } from '@vue/test-utils'
import Logs from '@/components/Logs'
import { nextTick } from 'vue'
let place
describe('Logs.vue', () => {
@@ -28,8 +29,7 @@ describe('Logs.vue', () => {
attachTo: place,
props: { messages, style: `height: ${containerHeight}px` }
})
await wrapper.vm.$nextTick()
await nextTick()
const height = wrapper.find('.logs-container').element.scrollHeight
expect(wrapper.find('.logs-container').element.scrollTop)
.to.equal(height - viewHeight)
@@ -52,11 +52,11 @@ describe('Logs.vue', () => {
props: { messages, style: `height: ${containerHeight}px` }
})
await wrapper.vm.$nextTick()
await nextTick()
messages.push({ type: 'error', message: 'msg 5' })
await wrapper.vm.$nextTick()
await wrapper.vm.$nextTick()
await nextTick()
await nextTick()
const height = wrapper.find('.logs-container').element.scrollHeight
expect(wrapper.find('.logs-container').element.scrollTop)
.to.equal(height - viewHeight)