import { test, expect } from '@playwright/test'; test.beforeEach(async ({ page }) => { await page.goto('/'); await page.evaluate(async () => { indexedDB.deleteDatabase('ttrpg-manager'); localStorage.clear(); }); await page.reload(); }); test('command palette navigates', async ({ page }) => { await page.keyboard.press('Control+k'); const input = page.getByLabel('Command search'); await expect(input).toBeVisible(); await input.fill('Dice'); await input.press('Enter'); await expect(page.getByRole('heading', { name: 'Dice' })).toBeVisible(); }); test('settings loads the sample campaign', async ({ page }) => { await page.getByLabel('Settings').click(); await expect(page.getByRole('heading', { name: 'Settings' })).toBeVisible(); await page.getByRole('button', { name: 'Load sample campaign' }).click(); await expect(page.getByRole('heading', { name: 'Sample: Lost Mine' })).toBeVisible(); // sample seeded characters (use the nav link, not the dashboard card) await page.getByLabel('Primary').getByRole('link', { name: 'Characters' }).click(); await expect(page.getByText('Lia the Brave')).toBeVisible(); });