dc0e8f701c
Phase 5 — live-session & multi-device hardening: - connectivityStore + SyncStatusIndicator in the shell: shows "Offline" when the browser is offline and the cloud autosave state (saving / saved / failed) when signed in; useCloudAutosave now reports its status. Owns online/offline events. - server presence heartbeat: protocol-level ping/pong per socket terminates a vanished connection (~30s), so a player who closes their laptop drops out of the GM's roster instead of lingering. No client changes needed. Phase 6 — onboarding & friction: - navigation: surfaced the previously orphaned routes in the rail — a new "World" group (Notes, NPCs, Quests, Calendar) and Homebrew + Assistant under Reference. (Empty-state hints and map rename already existed.) - combat keyboard control: n/→ next turn, p/← previous turn, guarded so it never fires while typing; button tooltips document it. Test hygiene: scoped now-ambiguous nav links in e2e to the Primary landmark, and fixed pre-existing stale emoji selectors in the realtime suite (📡 Host → Host, 📨 Just for you → Just for you) left over from the Living Codex emoji purge. Gate green: tsc + 277 unit + 34 e2e + 2 realtime. App + server build clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
1.3 KiB
TypeScript
32 lines
1.3 KiB
TypeScript
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('homebrew: create a custom monster and find it in the compendium', async ({ page }) => {
|
|
await page.getByRole('button', { name: '+ New campaign' }).first().click();
|
|
await page.locator('input[data-autofocus]').fill('Brew');
|
|
await page.getByRole('button', { name: 'Create' }).click();
|
|
await page.getByRole('link', { name: 'Dashboard' }).click();
|
|
await page.getByLabel('Primary').getByRole('link', { name: 'Homebrew' }).click();
|
|
|
|
// Create a homebrew monster and name it
|
|
await page.getByRole('button', { name: /New monster/ }).click();
|
|
const nameInput = page.getByLabel('Homebrew name');
|
|
await nameInput.fill('Dire Frog');
|
|
await page.getByLabel('Hit Points').fill('22');
|
|
|
|
// It shows up in the compendium bestiary with an HB badge
|
|
await page.getByRole('link', { name: 'Compendium' }).click();
|
|
await page.getByPlaceholder(/Search bestiary/i).fill('Dire Frog');
|
|
await page.getByRole('button', { name: /Dire Frog/ }).first().click();
|
|
await expect(page.getByText(/Homebrew monster/)).toBeVisible();
|
|
await expect(page.getByText('HB').first()).toBeVisible();
|
|
});
|