import { expect, test } from './fixtures.js' /** * Smoke suite — runs in demo mode (COMMITEA_E2E=1), where the main process serves * the fixed demo snapshot (apps/desktop/src/main/demo-snapshot.ts) with NO live * gitea. The app renders it through the exact same view builders as real data, so * these assertions exercise the real render path against deterministic input. * Full onboarding + agent flows live in the GITEA_LIVE-gated live-*.spec files. */ test('boots into the shell with the Focus screen', async ({ app, window }) => { await app.expectLoaded() await expect(window.getByText('Reginald', { exact: true })).toBeVisible() await expect(window.getByRole('heading', { name: 'Morning service' })).toBeVisible() await app.screenshot('shell-light') }) test('Focus shows the Now/Next/Later cards from the scheduler', async ({ window }) => { for (const slot of ['Now', 'Next', 'Later']) { await expect(window.getByText(slot, { exact: true })).toBeVisible() } // the cards link to real demo issues (which specific one is scheduler-dependent) await expect(window.getByRole('main').getByRole('link').first()).toBeVisible() }) test('Standup renders the drift / plan letter', async ({ app, window }) => { await app.nav('Standup').click() await expect(window.getByRole('heading', { name: 'Morning standup' })).toBeVisible() await expect(window.getByText("Today's plan")).toBeVisible() await app.screenshot('standup') }) test('Board: lifecycle columns, a demo issue, and the search filter', async ({ app, window }) => { await app.nav('The pot').click() await expect(window.getByRole('heading', { name: 'The pot' })).toBeVisible() // lifecycle columns populated by the demo snapshot's event stream await expect(window.getByText('Steeping', { exact: true })).toBeVisible() await expect(window.getByText('Done', { exact: true })).toBeVisible() await expect(window.getByText('Fix lifecycle inference on merge events')).toBeVisible() await app.screenshot('board') await window.getByPlaceholder(/Search the pot/).fill('monte carlo') await expect(window.getByText('Monte Carlo forecast bands on the runway')).toBeVisible() await expect(window.getByText('Fix lifecycle inference on merge events')).toBeHidden() await window.getByPlaceholder(/Search the pot/).fill('') // the Gantt + Dependencies tabs render from the same snapshot await window.getByRole('tab', { name: 'Gantt' }).click() await app.screenshot('gantt') await window.getByRole('tab', { name: 'Dependencies' }).click() await app.screenshot('deps') }) test('Runway shows the demo milestones', async ({ app, window }) => { await app.nav('Runway').click() await expect(window.getByRole('heading', { name: 'Runway' })).toBeVisible() await expect(window.getByText('Beta', { exact: true })).toBeVisible() await app.screenshot('runway') }) test('Inbox renders', async ({ app, window }) => { await app.nav('Inbox').click() await expect(window.getByRole('heading', { name: 'Inbox' })).toBeVisible() await app.screenshot('inbox') }) test('Capture: braindump prompt', async ({ app, window }) => { await app.nav('Capture').click() await expect(window.getByText("Tell me what you're planning")).toBeVisible() await app.screenshot('capture') }) test('Directives: the live ledger from pm-state', async ({ app, window }) => { await app.nav('Directives').click() await expect(window.getByRole('heading', { name: 'Directives' })).toBeVisible() await expect(window.getByText(/append-only · JSONL in pm-state/)).toBeVisible() // a demo directive quote from the snapshot await expect(window.getByText(/Beta ships the 12th, hard/)).toBeVisible() await app.screenshot('directives') }) test('Settings: connection + appearance, theme sync', async ({ app, window }) => { await app.nav('Settings').click() await expect(window.getByRole('heading', { name: 'Settings' })).toBeVisible() await expect(window.getByRole('heading', { name: 'Connection' })).toBeVisible() await app.screenshot('settings') await window.getByText('Evening (dark)').click() await expect(window.locator('html')).toHaveAttribute('data-theme', 'dark') }) test('issue drill-in from a Focus card and back', async ({ app, window }) => { // Focus cards render the issue title as a link; open the first and come back. await window.getByRole('main').getByRole('link').first().click() await expect(window.getByRole('button', { name: 'Back' })).toBeVisible() await app.screenshot('issue') await window.getByRole('button', { name: 'Back' }).click() await expect(window.getByRole('heading', { name: 'Morning service' })).toBeVisible() }) test('Evening service toggle flips the document theme', async ({ app, window }) => { await window.getByText('Evening service', { exact: true }).click() await expect(window.locator('html')).toHaveAttribute('data-theme', 'dark') await app.screenshot('shell-dark') }) test('exposes the commitea preload API', async ({ app }) => { const api = await app.preloadApi() expect(api).toBeDefined() expect(api).toHaveProperty('platform') })