import { expect, test } from './fixtures.js' test('boots and renders the primitives gallery', async ({ app, window }) => { await expect(window.getByRole('heading', { name: 'Primitives' })).toBeVisible() await expect(window.getByRole('button', { name: 'Brew plan' })).toBeVisible() await app.screenshot('primitives-light') }) test('primitives cover core, forms, and feedback', async ({ window }) => { // section headings prove each cluster ported and rendered for (const section of ['Button', 'Badge', 'Tag', 'Card', 'Input & Select', 'Feedback']) { await expect(window.getByRole('heading', { name: section, exact: true })).toBeVisible() } // a mono label chip renders verbatim await expect(window.getByText('deadline/hard')).toBeVisible() }) test('dark theme toggle flips the document theme', async ({ app, window }) => { await window.getByRole('button', { name: 'Switch to dark' }).click() await expect(window.locator('html')).toHaveAttribute('data-theme', 'dark') await app.screenshot('primitives-dark') }) test('dialog opens on demand and closes on Escape', async ({ window }) => { await window.getByRole('button', { name: 'Open dialog' }).click() const dialog = window.getByRole('dialog') await expect(dialog).toBeVisible() await expect(dialog.getByText('Withdraw directive?')).toBeVisible() await window.keyboard.press('Escape') await expect(dialog).toBeHidden() }) test('exposes the commitea preload API', async ({ app }) => { const api = await app.preloadApi() expect(api).toBeDefined() expect(api).toHaveProperty('platform') })