Fix Cypress failures: stub replag script, format ZIM date in UTC#1214
Merged
Conversation
The replag banner script is fetched live from wmflabs on every page load; an upstream change made it throw in Cypress's Electron browser, failing all 13 specs. Stub it out in the support file, since no test asserts on the banner. Also fix a timezone bug exposed while re-running the suite: the ZIM next-generation date (a date-only YYYY-MM-DD string) was parsed as UTC midnight but formatted in local time, showing the previous day to viewers in timezones behind UTC. Format it in UTC. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
audiodude
enabled auto-merge
July 17, 2026 12:54
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1214 +/- ##
=======================================
Coverage 92.64% 92.64%
=======================================
Files 78 78
Lines 4987 4987
=======================================
Hits 4620 4620
Misses 367 367 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI's
frontend-cypressjob started failing on every spec (13 of 13, 62 failures) with:The replag banner script is fetched live from wmflabs on every page load (
index.html). An upstream change to it (it now passes a new-spec Sanitizer config toElement.setHTML()) throws in Cypress's bundled Electron browser, and Cypress fails any test whose app throws an uncaught exception. Nothing in this repo changed —mainwas green two days before the same code went red.Fixes
replag-embed.jsincypress/support/e2e.js: a globalcy.interceptserves an empty body for the script, so tests no longer execute third-party code fetched over the network (also removes a flakiness/external-dependency liability). No test asserts on the banner. Real browsers are unaffected.ZimFile.vue): found while re-running the suite locally. The backend sends a date-onlyYYYY-MM-DDstring, whichnew Date()parses as UTC midnight, but it was formatted in the viewer's local timezone — so the zimFile spec's "shows the next generation date" test fails in any timezone behind UTC, and real users west of UTC see the previous day. AddingtimeZone: 'UTC'totoLocaleDateStringfixes both. (This never failed in CI, which runs in UTC.)Testing
Full Cypress suite run locally against the dev stack, twice: 193/193 passing across all 13 specs.
🤖 Generated with Claude Code