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