})
})
- // beforeEach(async () => {
- // await page().goto(baseUrl)
- // await page().waitForSelector('#app')
- // })
-
- // workaround for https://github.com/vitest-dev/vitest/issues/2756
- function runTest(desc: string, runner: any, timeout?: number) {
- test(
- desc,
- async () => {
- await page().goto(baseUrl)
- await page().waitForSelector('#app')
- await runner()
- },
- timeout
- )
- }
+ beforeEach(async () => {
+ await page().goto(baseUrl)
+ await page().waitForSelector('#app')
+ })
describe('transition with v-if', () => {
- runTest(
+ test(
'basic transition',
async () => {
await page().goto(baseUrl)
E2E_TIMEOUT
)
- runTest(
+ test(
'named transition',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'custom transition classes',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'transition with dynamic name',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'transition events without appear',
async () => {
const beforeLeaveSpy = vi.fn()
E2E_TIMEOUT
)
- runTest(
+ test(
'events with arguments',
async () => {
const beforeLeaveSpy = vi.fn()
E2E_TIMEOUT
)
- runTest('onEnterCancelled', async () => {
+ test('onEnterCancelled', async () => {
const enterCancelledSpy = vi.fn()
await page().exposeFunction('enterCancelledSpy', enterCancelledSpy)
expect(await html('#container')).toBe('<!--v-if-->')
})
- runTest(
+ test(
'transition on appear',
async () => {
const appearClass = await page().evaluate(async () => {
E2E_TIMEOUT
)
- runTest(
+ test(
'transition events with appear',
async () => {
const onLeaveSpy = vi.fn()
E2E_TIMEOUT
)
- runTest(
+ test(
'css: false',
async () => {
const onBeforeEnterSpy = vi.fn()
E2E_TIMEOUT
)
- runTest(
+ test(
'no transition detected',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'animations',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'explicit transition type',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'transition on SVG elements',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'custom transition higher-order component',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'transition on child components with empty root node',
async () => {
await page().evaluate(() => {
describe('transition with Suspense', () => {
// #1583
- runTest(
+ test(
'async component transition inside Suspense',
async () => {
const onLeaveSpy = vi.fn()
)
// #1689
- runTest(
+ test(
'static node transition inside Suspense',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'out-in mode with Suspense',
async () => {
const onLeaveSpy = vi.fn()
)
// #3963
- runTest(
+ test(
'Suspense fallback should work with transition',
async () => {
await page().evaluate(() => {
})
describe('transition with v-show', () => {
- runTest(
+ test(
'named transition with v-show',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'transition events with v-show',
async () => {
const beforeLeaveSpy = vi.fn()
E2E_TIMEOUT
)
- runTest(
+ test(
'onLeaveCancelled (v-show only)',
async () => {
const onLeaveCancelledSpy = vi.fn()
E2E_TIMEOUT
)
- runTest(
+ test(
'transition on appear with v-show',
async () => {
const beforeEnterSpy = vi.fn()
)
// #4845
- runTest(
+ test(
'transition events should not call onEnter with v-show false',
async () => {
const beforeEnterSpy = vi.fn()
})
describe('explicit durations', () => {
- runTest(
+ test(
'single value',
async () => {
await page().evaluate(duration => {
E2E_TIMEOUT
)
- runTest(
+ test(
'enter with explicit durations',
async () => {
await page().evaluate(duration => {
E2E_TIMEOUT
)
- runTest(
+ test(
'leave with explicit durations',
async () => {
await page().evaluate(duration => {
E2E_TIMEOUT
)
- runTest(
+ test(
'separate enter and leave',
async () => {
await page().evaluate(duration => {
E2E_TIMEOUT
)
- runTest(
+ test(
'warn invalid durations',
async () => {
createApp({
)
})
- runTest('warn when used on multiple elements', async () => {
+ test('warn when used on multiple elements', async () => {
createApp({
render() {
return h(Transition, null, {
).toHaveBeenWarned()
})
- runTest('warn when invalid transition mode', () => {
+ test('warn when invalid transition mode', () => {
createApp({
template: `
<div id="container">
})
// #3227
- runTest(`HOC w/ merged hooks`, async () => {
+ test(`HOC w/ merged hooks`, async () => {
const innerSpy = vi.fn()
const outerSpy = vi.fn()
expect(root.innerHTML).toBe(`<!---->`)
})
- runTest(
+ test(
'should work with dev root fragment',
async () => {
await page().evaluate(() => {
const transitionFinish = (time = duration) => timeout(time + buffer)
- // beforeEach(async () => {
- // await page().goto(baseUrl)
- // await page().waitForSelector('#app')
- // })
-
- // workaround for https://github.com/vitest-dev/vitest/issues/2756
- function runTest(desc: string, runner: any, timeout?: number) {
- test(
- desc,
- async () => {
- await page().goto(baseUrl)
- await page().waitForSelector('#app')
- await runner()
- },
- timeout
- )
- }
+ beforeEach(async () => {
+ await page().goto(baseUrl)
+ await page().waitForSelector('#app')
+ })
- runTest(
+ test(
'enter',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'leave',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'enter + leave',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'appear',
async () => {
const appearHtml = await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'move',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'dynamic name',
async () => {
await page().evaluate(() => {
E2E_TIMEOUT
)
- runTest(
+ test(
'events',
async () => {
const onLeaveSpy = vi.fn()
E2E_TIMEOUT
)
- runTest('warn unkeyed children', () => {
+ test('warn unkeyed children', () => {
createApp({
template: `
<transition-group name="test">