add ts test

This commit is contained in:
Simon Knott 2024-10-04 12:24:39 +02:00
parent 97c4582c97
commit 39efe83d15
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 12 additions and 1 deletions

View file

@ -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 component = await mount(HelloWorld, { slots });

View file

@ -2,6 +2,7 @@ import { test, expect } from '@playwright/experimental-ct-vue';
import DefaultSlot from '@/components/DefaultSlot.vue';
import NamedSlots from '@/components/NamedSlots.vue';
import Button from '@/components/Button.vue';
import HelloWorld from "@/components/HelloWorld.vue";
test('render a default slot', async ({ mount }) => {
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('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');
});