add ts test
This commit is contained in:
parent
97c4582c97
commit
39efe83d15
|
|
@ -52,7 +52,7 @@ test('render a component with a named slot', async ({ mount }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
test('updating default slot should work', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32809' } }, async ({ mount }) => {
|
test('updating slot should work', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32809' } }, async ({ mount }) => {
|
||||||
const slots = { default: 'foo' };
|
const slots = { default: 'foo' };
|
||||||
|
|
||||||
const component = await mount(HelloWorld, { slots });
|
const component = await mount(HelloWorld, { slots });
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { test, expect } from '@playwright/experimental-ct-vue';
|
||||||
import DefaultSlot from '@/components/DefaultSlot.vue';
|
import DefaultSlot from '@/components/DefaultSlot.vue';
|
||||||
import NamedSlots from '@/components/NamedSlots.vue';
|
import NamedSlots from '@/components/NamedSlots.vue';
|
||||||
import Button from '@/components/Button.vue';
|
import Button from '@/components/Button.vue';
|
||||||
|
import HelloWorld from "@/components/HelloWorld.vue";
|
||||||
|
|
||||||
test('render a default slot', async ({ mount }) => {
|
test('render a default slot', async ({ mount }) => {
|
||||||
const component = await mount(DefaultSlot, {
|
const component = await mount(DefaultSlot, {
|
||||||
|
|
@ -49,3 +50,13 @@ test('render a component with a named slot', async ({ mount }) => {
|
||||||
await expect(component).toContainText('Main Content');
|
await expect(component).toContainText('Main Content');
|
||||||
await expect(component).toContainText('Footer');
|
await expect(component).toContainText('Footer');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('updating slot should work', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32809' } }, async ({ mount }) => {
|
||||||
|
const slots = { default: 'foo' };
|
||||||
|
|
||||||
|
const component = await mount(HelloWorld, { slots });
|
||||||
|
await expect(component).toHaveText('foo');
|
||||||
|
|
||||||
|
await component.update({ slots });
|
||||||
|
await expect(component).toHaveText('foo');
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue