import { test, expect } from '@playwright/experimental-ct-vue'
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 MultiRoot from './components/MultiRoot.vue'
import EmptyTemplate from './components/EmptyTemplate.vue'
import type { HooksConfig } from '../playwright'
test.use({ viewport: { width: 500, height: 500 } })
test('render props', async ({ mount }) => {
const component = await mount()
await expect(component).toContainText('Submit')
})
test('renderer and keep the component instance intact', async ({ mount }) => {
const component = await mount();
await expect(component.locator('#rerender-count')).toContainText('9001')
await component.update()
await expect(component.locator('#rerender-count')).toContainText('1337')
await component.update()
await expect(component.locator('#rerender-count')).toContainText('42')
await expect(component.locator('#remount-count')).toContainText('1')
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
const messages: string[] = []
const component = await mount(