Phase 6: character creation & level-up

- Ability generation: standard array, point buy (27-pt, validated), 4d6kh3 roll;
  AbilityGenModal with assign-from-pool + steppers (pure abilityGen lib + tests)
- Level-up flow: increment level, HP gain (average or roll hit die + CON)
- Print / save-to-PDF: print button + @media print hides app chrome and roll tray
- Plan: added Phase 11 (data-driven Assistant) to the roadmap

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 01:56:23 +02:00
parent d5977e4c63
commit 522ff8abce
9 changed files with 331 additions and 4 deletions
+31
View File
@@ -0,0 +1,31 @@
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('generate ability scores and level up', async ({ page }) => {
await page.getByRole('button', { name: '+ New campaign' }).first().click();
await page.locator('input[data-autofocus]').fill('Build');
await page.getByRole('button', { name: 'Create' }).click();
await page.getByRole('link', { name: 'Characters' }).click();
await page.getByRole('button', { name: '+ New character' }).first().click();
await page.locator('input[data-autofocus]').fill('Builder');
await page.getByRole('button', { name: 'Create' }).click();
await page.getByRole('link', { name: /Builder/ }).click();
// Generate scores via standard array (default assignment 15,14,13,12,10,8)
await page.getByRole('button', { name: 'Generate' }).click();
await page.getByRole('button', { name: 'Apply' }).click();
await expect(page.getByLabel('STR score')).toHaveValue('15');
// Level up from 1 -> 2
await page.getByRole('button', { name: 'Level up' }).click();
await page.getByRole('button', { name: 'Level up' }).last().click();
await expect(page.getByRole('spinbutton', { name: 'Level', exact: true })).toHaveValue('2');
});