mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
17 lines
460 B
TypeScript
17 lines
460 B
TypeScript
import { test, expect } from '@playwright/experimental-ct-svelte';
|
|
import Button from '@/components/Button.svelte';
|
|
|
|
test('emit an submit event when the button is clicked', async ({ mount }) => {
|
|
const messages: string[] = [];
|
|
const component = await mount(Button, {
|
|
props: {
|
|
title: 'Submit',
|
|
},
|
|
on: {
|
|
submit: (data: string) => messages.push(data),
|
|
},
|
|
});
|
|
await component.click();
|
|
expect(messages).toEqual(['hello']);
|
|
});
|