test(timeslider): port legacy mocha specs to Playwright, retire orphaned suite#7949
Conversation
…ned suite The legacy src/tests/frontend/specs/ mocha suite is run by no CI workflow, so its timeslider coverage was dead — a regression in the in-pad history UI (ether#7659/ether#7946) sailed through CI. Port the still-meaningful cases to frontend-new Playwright specs, re-targeted at the real in-pad UI (outer banner / slider / export links that pad_mode.ts drives) rather than the isolated ?embed=1 iframe the existing specs use: - timeslider_revision_labels.spec.ts (from timeslider_labels.js): the #history-banner shows 'Version N' + a valid (non-NaN) date and timer, and both update when scrubbing to revision 0. - timeslider_export_links.spec.ts (from timeslider_numeric_padID.js and the 'checks the export url' case of timeslider_revisions.js): the outer export hrefs target /p/<pad>/<rev>/export/<type> for the viewed revision, including a numeric pad id, and follow the slider to revision 0. - timeslider_deeplink.spec.ts (from the 'jumps to a revision given in the url' case): a #rev/N hash — and the legacy #N shortlink form — boots straight into history mode at that revision. Delete the three now-ported legacy specs. Verified passing on Chromium and Firefox. The star-marker case of timeslider_revisions.js is already covered by timeslider_saved_revisions.spec.ts (ether#7948). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Code Review by Qodo
1.
|
PR Summary by QodoPort timeslider legacy Mocha specs to Playwright and remove orphaned suite WalkthroughsDescription• Add Playwright coverage for in-pad history banner, export links, and deep-link entry • Retarget timeslider assertions from embedded iframe to real outer pad history UI • Delete legacy Mocha timeslider specs that were not executed by CI Diagramgraph TD
A["Playwright runner (CI)"] --> B["New timeslider specs"] --> C["Pad editor UI"] --> D["History mode (outer UI)"]
D --> E["Revision banner asserts"]
D --> F["Export link asserts"]
D --> G["Deep-link hash asserts"]
High-Level AssessmentThe following are alternative approaches to this PR: 1. Re-enable legacy Mocha frontend specs in CI
2. Keep iframe-focused Playwright tests and add separate outer-UI tests
3. Introduce shared history-mode helper utilities
Recommendation: The PR’s approach (porting to Playwright and explicitly targeting the real in-pad/outer history UI) is the best long-term option: it closes the CI gap with tests that match user interaction surfaces and consolidates around the actively-run test framework. Consider a follow-up to factor common history-mode helpers once more specs accumulate. File ChangesTests (3)
|
Assert the canonical #rev/0 URL and the slider landing on revision 0 rather than the #history-banner-rev label text. The banner label is populated via a MutationObserver bridge that races the iframe load on the bootstrap path in Firefox (it is already covered for the normal button-entry flow by timeslider_revision_labels.spec.ts); the URL + slider value are the deterministic signals that the deep link entered history at the right revision. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Pin locale to en-US in the revision-labels spec so the localized 'Version N' label and 'Saved <Month> <day>, <year>' date assertions are deterministic and the date stays Date-parseable, instead of depending on the runner's locale. - Use a high-entropy numeric pad id (timestamp + random) in the export-links spec so reruns against a persistent DB can't collide on the same pad. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Both addressed in 24f4d6d: 1. Locale-fragile banner assertions — Verified. The 2. Numeric padId collision risk — Verified. The Re-verified both specs on Chromium and Firefox. |
Close the timeslider CI coverage gap
Follow-up to #7948. While fixing #7946 we found that the legacy mocha suite (
src/tests/frontend/specs/) is run by no CI workflow —frontend-tests.ymlonly runs Playwright (tests/frontend-new/specs/). That's why a regression in the in-pad history UI (#7659) reached a release: the timeslider's only coverage lived in dead specs, and the modern Playwright specs drive the isolated?embed=1iframe and never exercise the outer in-pad UI users actually interact with.This ports the still-meaningful timeslider cases to Playwright, re-targeted at the real in-pad UI (outer history banner / slider / export links that
pad_mode.tsdrives), and deletes the orphaned originals.New specs
frontend-new)frontend, deleted)timeslider_revision_labels.spec.tstimeslider_labels.js#history-bannershowsVersion N+ a valid (non-NaN) date & timer, and both update when scrubbing to rev 0timeslider_export_links.spec.tstimeslider_numeric_padID.js+ the "checks the export url" case oftimeslider_revisions.js/p/<pad>/<rev>/export/<type>for the viewed revision — incl. a numeric pad id — and follow the slider to rev 0timeslider_deeplink.spec.tstimeslider_revisions.js#rev/Nhash, and the legacy#Nshortlink, boot straight into history mode at that revision (bootstrapFromHash)The star-marker case of
timeslider_revisions.jsis already covered bytimeslider_saved_revisions.spec.tsin #7948.Verification
All new specs pass on Chromium and Firefox locally; type-check clean. These now run in PR CI, so the in-pad history banner, export-link rewriting, and deep-link entry are gated against regression.
🤖 Generated with Claude Code