Improve campaign log roll cards

This commit is contained in:
2026-04-03 22:58:55 +02:00
parent 9581442cab
commit b26d58cea4
12 changed files with 353 additions and 36 deletions

View File

@@ -58,6 +58,7 @@ test("Rolemaster open-ended roll detail renders specialized dice chips", async (
await page.goto("/");
await expect(page.getByText("Campaign Log")).toBeVisible();
await expect(page.locator(".log-panel .log-event-badge")).toHaveText("Fumble");
const logEntry = page.locator(".log-panel .log-entry-toggle").first();
await expect(logEntry).toBeVisible();
@@ -68,6 +69,35 @@ test("Rolemaster open-ended roll detail renders specialized dice chips", async (
await expect(page.locator(".log-detail .roll-dice-strip")).toBeVisible();
});
test("newly rolled log entry auto-expands", async ({ page, context }) => {
const username = `d6-log-${Date.now()}`;
await registerAndLogin(context.request, username, "D6 Auto Expand");
const campaign = await postJson(context.request, "/api/campaigns", {
name: "D6 Auto Expand",
rulesetId: "d6"
});
const character = await postJson(context.request, "/api/characters", {
name: "Auto Hero",
campaignId: campaign.id
});
await postJson(context.request, `/api/characters/${character.id}/skills`, {
name: "Stealth",
diceRollDefinition: "2D+1",
wildDice: 1,
allowFumble: true
});
await page.goto("/");
await expect(page.getByText("Campaign Log")).toBeVisible();
await page.getByRole("button", { name: "Roll Stealth" }).click();
const expandedEntry = page.locator(".log-panel .log-entry.expanded").first();
await expect(expandedEntry).toBeVisible();
await expect(expandedEntry.locator(".log-detail .roll-dice-strip")).toBeVisible();
});
test("Rolemaster UI exposes conditional create and edit fields", async ({ page, context }) => {
const username = `rm-ui-${Date.now()}`;
await registerAndLogin(context.request, username, "Rolemaster UI");