import { expect, test } from './fixtures.js' test('boots into the shell: rail, main, and Reginald panel', async ({ app, window }) => { await app.expectLoaded() await expect(window.getByText('Reginald', { exact: true })).toBeVisible() // default view is Morning service await expect(window.getByRole('heading', { name: 'Morning service' })).toBeVisible() await app.screenshot('shell-light') }) test('rail navigation switches the main view', async ({ app, window }) => { await app.nav('The pot').click() await expect(window.getByRole('heading', { name: 'The pot' })).toBeVisible() await app.nav('States').click() await expect(window.getByRole('heading', { name: 'States' })).toBeVisible() await expect(window.getByText('The pot is empty')).toBeVisible() await app.screenshot('shell-states') }) test('Evening service toggle flips the document theme', async ({ app, window }) => { // the switch's real input is visually hidden — click the label text to toggle await window.getByText('Evening service', { exact: true }).click() await expect(window.locator('html')).toHaveAttribute('data-theme', 'dark') await expect(window.getByRole('switch', { name: 'Evening service' })).toBeChecked() await app.screenshot('shell-dark') }) test('offline sim shows the banner and disables the composer', async ({ window }) => { await window.getByRole('button', { name: /Connection/ }).click() await expect(window.getByText(/Gitea isn.t answering/)).toBeVisible() await expect(window.getByRole('textbox')).toBeDisabled() }) test('chat composer echoes a canned reply (fixture)', async ({ window }) => { await window.getByRole('textbox').fill('Push pilots first') await window.keyboard.press('Enter') await expect(window.getByText('Push pilots first')).toBeVisible() await expect(window.getByText(/Noted and logged as a directive/)).toBeVisible() }) test('issue drill-in and back-stack of one', async ({ window }) => { await window.getByRole('button', { name: 'Preview an issue page' }).click() await expect(window.getByRole('heading', { name: 'Issue' })).toBeVisible() await window.getByRole('button', { name: 'Back' }).click() // returns to the view we drilled in from await expect(window.getByRole('heading', { name: 'Morning service' })).toBeVisible() }) test('exposes the commitea preload API', async ({ app }) => { const api = await app.preloadApi() expect(api).toBeDefined() expect(api).toHaveProperty('platform') })