kammer/e2e/specs/pages/settings.spec.ts
Christopher Mühl ba68fb456a test: E2E test suite + handoff documentation
50 Playwright E2E tests across 13 spec files covering all routes and
user flows (items CRUD, check-out/in, locations, labels, scanning,
search/filter). Uses vitest as runner with playwright-core for browser
automation (bun-compatible alternative to @playwright/test).

Includes Gherkin .feature files as living documentation, test support
infrastructure (IDB seeding, item factories, assertion helpers, layout
measurement), and HANDOFF.md covering project state, deployment, and
open design decisions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 20:53:08 +01:00

41 lines
1.3 KiB
TypeScript

/**
* @feature Settings
* @see e2e/features/pages/settings.feature
*/
import { describe, test } from 'vitest';
import { setupBrowser } from '../../support/browser';
import { waitForAppReady } from '../../support/seed';
import { expectVisible, expectText } from '../../support/expect';
const { getPage } = setupBrowser();
describe('Settings', () => {
test('settings page shows sections', async () => {
const page = getPage();
await page.goto('/settings');
await waitForAppReady(page);
await expectText(page.getByRole('heading', { level: 1 }), 'Settings');
await expectVisible(page.getByText('Database'));
await expectVisible(page.getByRole('heading', { name: 'Sync' }));
await expectVisible(page.getByRole('heading', { name: 'About' }));
});
test('database stats show counts', async () => {
const page = getPage();
await page.goto('/settings');
await waitForAppReady(page);
await expectVisible(page.locator('main').getByText('Items'));
await expectVisible(page.locator('main').getByText('Locations'));
});
test('about section shows version', async () => {
const page = getPage();
await page.goto('/settings');
await waitForAppReady(page);
await expectVisible(page.getByText('SolidHaus v0.1.0'));
await expectVisible(page.getByText('Data is stored locally'));
});
});