7100ea8dd4
- Homebrew entity (monster/spell/item/feat/condition) — Dexie v6, repo, hook, cascade-deleted with campaign - Homebrew editor page: per-kind fields + description, create/edit/delete - Compendium merges campaign homebrew of the matching kind (HB badge, generic HomebrewDetail) with the same cross-links (add monster->combat, spell/item->character) - Content packs: export/import homebrew as JSON (validated, ids reassigned) - System extensibility documented via the existing RulesSystem registry seam - Fix: card editors (homebrew/npc/quest/note) debounce-save the FULL snapshot, not partial patches — editing two fields fast no longer drops an edit New homebrew e2e + cascade test coverage. 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.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();
|
|
});
|