test(TransitionGroup): test for TransitionGroup (#1269)
This commit is contained in:
@@ -5,12 +5,21 @@ import { h, createApp, Transition } from 'vue'
|
||||
|
||||
describe('e2e: Transition', () => {
|
||||
mockWarn()
|
||||
const { page, html, classList, isVisible } = setupPuppeteer()
|
||||
const {
|
||||
page,
|
||||
html,
|
||||
classList,
|
||||
isVisible,
|
||||
timeout,
|
||||
nextFrame
|
||||
} = setupPuppeteer()
|
||||
const baseUrl = `file://${path.resolve(__dirname, './transition.html')}`
|
||||
|
||||
const duration = 50
|
||||
const buffer = 5
|
||||
|
||||
const transitionFinish = (time = duration) => timeout(time + buffer)
|
||||
|
||||
const classWhenTransitionStart = () =>
|
||||
page().evaluate(() => {
|
||||
(document.querySelector('#toggleBtn') as any)!.click()
|
||||
@@ -19,21 +28,6 @@ describe('e2e: Transition', () => {
|
||||
})
|
||||
})
|
||||
|
||||
const transitionFinish = (time = duration) =>
|
||||
new Promise(r => {
|
||||
setTimeout(r, time + buffer)
|
||||
})
|
||||
|
||||
const nextFrame = () => {
|
||||
return page().evaluate(() => {
|
||||
return new Promise(resolve => {
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(resolve)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
beforeEach(async () => {
|
||||
await page().goto(baseUrl)
|
||||
await page().waitFor('#app')
|
||||
|
||||
Reference in New Issue
Block a user