Skip to content

Commit b3bdd70

Browse files
authored
test(Transition): more complete transition e2e tests (#1151)
1 parent f54be6a commit b3bdd70

File tree

10 files changed

+1645
-107
lines changed

10 files changed

+1645
-107
lines changed

packages/vue/__tests__/Transition.spec.ts

+1,636
Large diffs are not rendered by default.

packages/vue/examples/__tests__/e2eUtils.ts renamed to packages/vue/__tests__/e2eUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function setupPuppeteer() {
7979
await page.$eval(
8080
selector,
8181
(node, value) => {
82-
(node as HTMLInputElement).value = value
82+
;(node as HTMLInputElement).value = value
8383
node.dispatchEvent(new Event('input'))
8484
},
8585
value

packages/vue/examples/transition/index.html renamed to packages/vue/__tests__/transition.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
<script src="../../dist/vue.global.js"></script>
2-
<div id="app"></div>
3-
<script>
4-
Vue.createApp({
5-
template: `
6-
<div id="test"><transition><div v-if="toggle" class="test">content</div></transition></div>
7-
<button @click="click">button</button>
8-
`,
9-
setup:() => {
10-
const toggle = Vue.ref(true)
11-
const click = () => toggle.value = !toggle.value
12-
return { toggle, click }
13-
}
14-
}).mount('#app')
15-
</script>
1+
<script src="../dist/vue.global.js"></script>
162

3+
<div id="app"></div>
174
<style>
185
.test {
196
-webkit-transition: opacity 50ms ease;

packages/vue/examples/__tests__/commits.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path'
2-
import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
2+
import { setupPuppeteer, E2E_TIMEOUT } from '../../__tests__/e2eUtils'
33
import mocks from './commits.mock'
44

55
describe('e2e: commits', () => {

packages/vue/examples/__tests__/grid.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path'
2-
import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
2+
import { setupPuppeteer, E2E_TIMEOUT } from '../../__tests__/e2eUtils'
33

44
interface TableData {
55
name: string

packages/vue/examples/__tests__/markdown.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path'
2-
import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
2+
import { setupPuppeteer, E2E_TIMEOUT } from '../../__tests__/e2eUtils'
33

44
describe('e2e: markdown', () => {
55
const { page, isVisible, value, html } = setupPuppeteer()

packages/vue/examples/__tests__/svg.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path'
2-
import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
2+
import { setupPuppeteer, E2E_TIMEOUT } from '../../__tests__/e2eUtils'
33

44
declare const globalStats: {
55
label: string

packages/vue/examples/__tests__/todomvc.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path'
2-
import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
2+
import { setupPuppeteer, E2E_TIMEOUT } from '../../__tests__/e2eUtils'
33

44
describe('e2e: todomvc', () => {
55
const {

packages/vue/examples/__tests__/transition/Transition.spec.ts

-85
This file was deleted.

packages/vue/examples/__tests__/tree.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path'
2-
import { setupPuppeteer, E2E_TIMEOUT } from './e2eUtils'
2+
import { setupPuppeteer, E2E_TIMEOUT } from '../../__tests__/e2eUtils'
33

44
describe('e2e: tree', () => {
55
const { page, click, count, text, children, isVisible } = setupPuppeteer()

0 commit comments

Comments
 (0)