test(ct): vue2 cli (#16693)
This commit is contained in:
parent
fea8772d95
commit
c3f39faefc
|
|
@ -1,7 +1,5 @@
|
|||
<template>
|
||||
<button @click='$emit("submit", "hello")'>
|
||||
{{ title }}
|
||||
</button>
|
||||
<button @click="$emit('submit', 'hello')">{{ title }}</button>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<div>test</div>
|
||||
</template>
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
<header>
|
||||
<slot name="header" />
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<slot name="main" />
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import NamedSlots from './components/NamedSlots.vue'
|
|||
test.use({ viewport: { width: 500, height: 500 } })
|
||||
|
||||
test('props should work', async ({ mount }) => {
|
||||
const component = await mount(<Button title='Submit'></Button>)
|
||||
const component = await mount(<Button title="Submit" />)
|
||||
await expect(component).toContainText('Submit')
|
||||
})
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ test('slot should emit events', async ({ mount }) => {
|
|||
test('should run hooks', async ({ page, mount }) => {
|
||||
const messages = []
|
||||
page.on('console', m => messages.push(m.text()))
|
||||
await mount(<Button title='Submit'></Button>, {
|
||||
await mount(<Button title="Submit" />, {
|
||||
hooksConfig: { route: 'A' }
|
||||
})
|
||||
expect(messages).toEqual(['Before mount: {\"route\":\"A\"}', 'After mount el: HTMLButtonElement'])
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { test, expect } from '@playwright/experimental-ct-vue2'
|
||||
|
||||
import Button from './components/Button.vue'
|
||||
import Counter from './components/Counter.vue'
|
||||
import DefaultSlot from './components/DefaultSlot.vue'
|
||||
import NamedSlots from './components/NamedSlots.vue'
|
||||
import Component from './components/Component.vue'
|
||||
|
||||
test.use({ viewport: { width: 500, height: 500 } })
|
||||
|
||||
|
|
@ -79,6 +79,11 @@ test('named slots should work', async ({ mount }) => {
|
|||
await expect(component).toContainText('Footer')
|
||||
})
|
||||
|
||||
test('optionless should work', async ({ mount }) => {
|
||||
const component = await mount(Component)
|
||||
await expect(component).toContainText('test')
|
||||
})
|
||||
|
||||
test('should run hooks', async ({ page, mount }) => {
|
||||
const messages = []
|
||||
page.on('console', m => messages.push(m.text()))
|
||||
|
|
|
|||
Loading…
Reference in a new issue