mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(ct): support components w/o mount options (#15501)
This commit is contained in:
parent
2e331715ff
commit
dd0eb5fb1d
@ -76,7 +76,7 @@ export const fixtures: Fixtures<
|
||||
},
|
||||
};
|
||||
|
||||
async function innerMount(page: Page, jsxOrType: JsxComponent | string, options?: ObjectComponentOptions): Promise<string> {
|
||||
async function innerMount(page: Page, jsxOrType: JsxComponent | string, options: ObjectComponentOptions = {}): Promise<string> {
|
||||
let component: Component;
|
||||
if (typeof jsxOrType === 'string')
|
||||
component = { kind: 'object', type: jsxOrType, options };
|
||||
|
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>test</div>
|
||||
</template>
|
@ -3,6 +3,7 @@ import { test, expect } from '@playwright/experimental-ct-vue'
|
||||
import Button from './components/Button.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 } })
|
||||
|
||||
@ -60,3 +61,8 @@ test('named slots should work', async ({ mount }) => {
|
||||
await expect(component).toContainText('Main Content')
|
||||
await expect(component).toContainText('Footer')
|
||||
})
|
||||
|
||||
test('optionless should work', async ({ mount }) => {
|
||||
const component = await mount(Component)
|
||||
await expect(component).toContainText('test')
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user