Redesign DM Dashboard (/dm/, /ru/dm/) with purple-gold theme (#534AB7 + #c8a84b): Design System: - Update dm-theme.css with 49 purple-gold tokens (transitions, shadows, hover states) - Create DmTabs.astro with ARIA, keyboard nav, URL hash sync, localStorage persistence - Create DmSidebar.astro for desktop navigation - Redesign DmHeader with gold accent - Update DmButton, DmCard, DmInput primitives - Expand i18n to 47 strings Layout: - Redesign DmLayout with 3-column dashboard grid (sidebar|main|context) - Update /dm/index.astro and /ru/dm/index.astro with named slots Feature Components: - DiceRoller: empty state, ARIA live, color-coded history, storage key fallback - InitiativeTracker: HP editing, active highlighting, storage key fallback - Open5eReference: skeletons, debounce, error retry, gold tabs - NotesPanel: cross-tab sync, copy-to-clipboard, auto-save - AuthPanel: VK/Yandex brand colors, pill buttons Tests: - Add 50 Playwright E2E tests (smoke, dice, initiative, reference, notes, data-migration) Fixes: - Document Open5e client.ts URL bugfix - Add backward-compatible storage key fallback for dice/initiative - Preserve legacy sessionStorage data on load
35 lines
1.5 KiB
TypeScript
35 lines
1.5 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
|
|
test.describe("Notes Panel", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/dm/#notes");
|
|
});
|
|
|
|
test("typing in textarea works", async ({ page }) => {
|
|
await page.fill("[data-testid='notes-textarea']:visible", "Тестовая заметка");
|
|
await expect(page.locator("[data-testid='notes-textarea']:visible")).toHaveValue("Тестовая заметка");
|
|
});
|
|
|
|
test("auto-save indicator appears", async ({ page }) => {
|
|
await page.fill("[data-testid='notes-textarea']:visible", "Тест");
|
|
await page.waitForTimeout(600);
|
|
await expect(page.locator("[data-testid='notes-saved-indicator']:visible")).toBeVisible();
|
|
});
|
|
|
|
test("clear button empties notes", async ({ page }) => {
|
|
await page.fill("[data-testid='notes-textarea']:visible", "Тестовая заметка");
|
|
await page.click("[data-testid='notes-clear-btn']:visible");
|
|
await expect(page.locator("[data-testid='notes-textarea']:visible")).toHaveValue("");
|
|
});
|
|
|
|
test("character counter updates", async ({ page }) => {
|
|
await page.fill("[data-testid='notes-textarea']:visible", "12345");
|
|
await expect(page.locator("[data-testid='notes-char-count']:visible")).toContainText("5");
|
|
});
|
|
|
|
test("mobile viewport renders correctly", async ({ page }) => {
|
|
await page.setViewportSize({ width: 375, height: 812 });
|
|
await expect(page.locator("[data-testid='notes-section']:visible")).toBeVisible();
|
|
});
|
|
});
|