Tests: shared helpers once in helpers.ts, not copied into each spec

- The panes view's pane, tid, frames, still, library, clickOpen and
  noFaults were copied into colours, panes3, panes4 (and partly forks,
  libraries, phone) with identical bodies; wide() into annotate and
  links; linksHere into review and reviewer; the one-key-per-frame loop
  of the latency tests into six specs (paced). They live in helpers.ts.
  The specs whose own still() or open() differ keep theirs.
- `:` + type + Enter written out where command() does the same, the
  newDoc alias of addTop, nodes' copy of focusedTitle, forks.test's four
  isStr guards, an unused fixture and `void request`, Math.max(x, x).
- panes3 and panes4 no longer call themselves rounds three and four.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
thalladaandClaude Opus 5.5 committed 2026-11-17 16:25:27 -05:00
1 parent 52cb7c2065
commit dbbe3effac
18 files changed
+176 -297

No files matched your search

+3 -8
View File
@@ -7,7 +7,7 @@
* directory, each state is saved there, light and dark.
*/
import { expect, test, type Page } from "@playwright/test";
import { autoLayout, seedLinks, settle, state } from "./helpers";
import { autoLayout, command, frames, seedLinks, settle, state } from "./helpers";
test.use({ viewport: { width: 390, height: 844 }, hasTouch: true, isMobile: true, deviceScaleFactor: 3 });
@@ -22,7 +22,6 @@ async function shot(page: Page, name: string) {
await page.emulateMedia({ colorScheme: "light" });
}
const frames = (page: Page) => page.evaluate(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))));
async function start(page: Page) {
await seedLinks(page.request);
@@ -347,13 +346,9 @@ test("the libraries panel, the top menu, and the other layouts are a tap away; a
await page.locator(".menu.sheet .choices button", { hasText: "auto" }).tap();
await at(page, "Fixed points", 1);
// /view panes: side by side even here; /view auto: pages again.
await page.keyboard.press(":");
await page.keyboard.type("/view panes");
await page.keyboard.press("Enter");
await command(page, "/view panes");
await expect(page.locator(".panes:not([data-layout])")).toHaveCount(1);
await page.keyboard.press(":");
await page.keyboard.type("/view auto");
await page.keyboard.press("Enter");
await command(page, "/view auto");
await at(page, "Fixed points", 1);
// Keys: Alt+h to where the pane was opened from, Alt+l back; l on a row opens it and goes there.
await page.keyboard.press("Alt+h");