Files
commitea/apps/desktop/e2e/smoke.spec.ts
Croissant Le Doux 635025113c feat(desktop): port the 15 design-system primitives (#14)
Verbatim port of the handoff primitives into components/ui/ — Icon,
Button, IconButton, Badge, Tag, Card, Tabs (core); Input, Select,
Checkbox, Radio, Switch (forms); Dialog, Toast, Tooltip (feedback).
Each keeps its injected token-referencing CSS byte-for-byte; the
handoff .d.ts contracts become the exported prop interfaces. Barrel at
components/ui/index.ts.

Adds a PrimitivesGallery (app root for now; real shell is P3-2) that
exercises every primitive with a light/dark toggle. Smoke suite asserts
the gallery, section coverage, theme flip, and dialog open/Escape;
screenshots captured for both themes. typecheck + 5 e2e green.

Closes P3-1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 12:12:00 -04:00

38 lines
1.5 KiB
TypeScript

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')
})