templates/vue/button.spec.ts
templates/vue/button.spec.tsBrowse 10 files
183 tokens
830 bytes
Token encoding: o200k_base
Snapshot 500c9c8
← Back to SKILL.md
1// Example component test. `mount` is a built-in fixture of @playwright/test.2// It returns a locator for the gallery root, scope the queries from there.3import { test, expect } from '@playwright/test';4 5test('renders primary button', async ({ mount }) => {6 const component = await mount('components/Button/Primary');7 await expect(component.getByRole('button')).toHaveText('Submit');8});9 10test('disabled button is disabled', async ({ mount }) => {11 const component = await mount('components/Button/Disabled');12 await expect(component.getByRole('button')).toBeDisabled();13});14 15test('button click fires callback', async ({ mount }) => {16 const component = await mount('components/Button/CountsClicks');17 await component.getByRole('button').click();18 await expect(component.getByTestId('click-count')).toHaveValue('1');19});20