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>
This commit is contained in:
@@ -1,15 +1,33 @@
|
||||
import { expect, test } from './fixtures.js'
|
||||
|
||||
test('boots and renders the CommiTea shell', async ({ app }) => {
|
||||
await app.expectLoaded()
|
||||
await app.screenshot('boot')
|
||||
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('renders the label-parse check from @commitea/core', async ({ window }) => {
|
||||
// Proves the core package is bundled + running in the renderer, not just
|
||||
// that the window opened. Updates as the scaffold gives way to real screens.
|
||||
await expect(window.getByText(/label parse check/i)).toBeVisible()
|
||||
await expect(window.getByText(/est\/3d · p\/2 · hard true/)).toBeVisible()
|
||||
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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user