Stop createEvent picking a past date for a future event - #903
Open
edwh wants to merge 1 commit into
Open
Conversation
The date click lands on the first day of the calendar's final week row - page.click is not strict, so it takes the first of the seven matches, not the last. In the current month that day is near the month's end, so for the last few days of every month it is on or before today. createEvent(past=false) then produced a finished event. EventActions renders a different branch for a finished event, with no Invite volunteers item at all, so the invite test timed out waiting for a dropdown item that was never going to appear. Nothing in the app had changed: the suite went red on 31 August because the calendar picked 30 August, and it had been green on 15 July when the same click landed in the future. Shift a month in the direction we want instead of relying on where today falls, mirroring what the past branch already did, and check the date we ended up with. Without that check a mis-picked date shows up as a puzzling timeout much later in whichever test used the helper. Verified against the local site with the browser clock faked: at 2026-08-31 the old click picks 2026-08-30 and at 2026-12-29 it picks 2026-12-27, both in the past; with the shift both dates land in the following month, and the invite test passes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
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.



develophas been red since 31 August, and it is a dormant fixture bug rather than a code regression.Cause
createEventpicks a date with:page.clickis not strict, so it takes the first of the seven matches in the final week row, not the last. That day sits near the end of the displayed month — so for the last few days of every month it is on or before today, andcreateEvent(past=false)silently produced a finished event.EventActionsrenders a different branch when an event is finished (Request review / Share event stats / Download event data) with no Invite volunteers item at all, so the test timed out waiting for a dropdown item that was never going to appear. The CI failure screenshot shows exactly that: an event dated 30 Aug 2026 on a run dated 31 Aug 2026, dropdown open on the finished branch.Green on 15 Jul, red on 31 Aug, with no relevant code change in between — the only two commits between those runs were the WordPress group avatar fix and its merge.
Fix
Shift a month in the direction we want, mirroring what the
pastbranch already did, then assert the date we actually landed on. Without that assertion a mis-picked date surfaces as a confusing timeout much later in whichever test used the helper.Verification
Against the local site with the browser clock faked (both the grid and the assertion are client-side):
Invite volunteers modal opens from Event Actions dropdownpasses locally with the change.This should also clear the same test's noise on #835.