Skip to content

Wire up the Playwright e2e harness for the dataset page's inline scripts #279

Open

Description

@neuromechanist

Problem

`package.json` declares a `test:e2e` script and depends on `@playwright/test`, but there is no `playwright.config.ts` and no `*.spec.ts` anywhere, so the harness is not wired up.

That leaves the imperative logic inlined in `src/pages/dataset/[id].astro` unreachable by any test: `revealRecordingRow` (ancestor walk, synthesized "Show next" clicks bounded by `REVEAL_MAX_CHUNK_CLICKS`, a hand-rolled selector-quote escape, a `requestAnimationFrame`-polled timeout), `applyUnitsNotice`, and the coverage-panel jump click delegate. An off-by-one in the ancestor walk or a selector that fails on a directory name containing a quote would only surface as "jump links silently do nothing" in production.

Surfaced by the review of #278 (Zarr coverage panel).

Proposed work

  • Add `playwright.config.ts` targeting the built site (`astro build` plus `wrangler dev` or `astro preview`), no network access to production.
  • Serve the existing fixtures (`test/fixtures/zarr/*.json`, a small BIDS listing) from a local stub so the specs stay hermetic.
  • Specs: jump link expands ancestors and scrolls to the stamped row; a pending 4D/BTi directory row is reachable; the units notice renders for a store with `kept_importer_unit`; the "Show next" loop yields between chunks.
  • Run the specs in CI on `staging` and `main` PRs.

Out of scope

Rewriting the inline scripts into importable modules; that is worth doing but is a separate refactor.

Activity

  1. neuromechanist commented on Sep 2, 2026

    @neuromechanist
    ContributorAuthor

    Related: #248 asks for a Playwright spec on the upload page state machine and would share the same playwright.config.ts and CI job; whichever lands first should set the harness up for both.

  2. neuromechanist commented on Sep 3, 2026

    @neuromechanist
    ContributorAuthor

    From the #294 review (epic #284): the new Use-this-data section and the .md mirror are both server-rendered and hold the agent-facing facts, so the no-JavaScript property is now load-bearing and nothing asserts it. When this harness lands, the cheapest guard is a spec that fetches a dataset page with JavaScript disabled and asserts the Use-this-data headings and the JSON-LD block are present; a source-level assertion that UseThisData.astro ships no script block would catch the common regression more cheaply still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions