e2e: give the calendar tests the dated cards their grids require #185
No reviewers
Labels
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/Ponente!185
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/e2e-calendar-empty-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
boards.spec.js:165("the nav switches boards…") andcalendar.spec.js:515("a six-week month fits a short window…") have been failing deterministically onmain. The app is right; the tests were wrong.Diagnosis. Since the calendar's emptiness check became month-scoped (
94bb97e, #85), a month with nothing due renders its empty state instead of the grid —.calendar-grid/.calendar-weekare not merely empty but absent. Both tests waited on those elements without ever minting a dated card, which is exactly the fresh-stack ruledocs/testing.mddocuments (andmobile.spec.jsonce broke the same way). CI cannot run the e2e suite, so the break was silent. The empty state itself is deliberate, and the entrance never gates it, so there is no stuck-invisible bug in the app.Fixes
CalendarMonthdoes (in UTC), dates one card there, and pages to it on the heading — the months walked through on the way have no grid to wait for. Its overflow measurement also stopped racing the entrance: the cascade lifts each week from 14px below its place (precisely--entrance-rise, precisely the overflow it then flaked with under full-run load), so the measurement finishes the animations first.finally, because a board holding cards refuses deletion by design (BoardNotEmptyException).docs/testing.md: the fresh-stack paragraph now names the calendar as its sharpest case.Verified: full Playwright suite 146/146 against a clean
--force-recreatestack built frommain; unit suite 448/448. (One unrelated flake ofaccess.spec.js:192appeared in one intermediate run and passed alone and in the final full run — the known circuit-attach race class from testing.md.)🤖 Generated with Claude Code
🤖 Reviewing this PR — follow along in the action run; the reply will link the full session transcript.
📜 Live transcript — updating every ~5 minutes while the task runs.
✅ Verdict: approve — no blocking issues found.
Verified the diagnosis and fix against the actual source rather than taking the PR description on faith:
Calendar.razor:770definesTodayasDateOnly.FromDateTime(DateTime.UtcNow), confirming the six-week test's UTC-based month math is the right basis for computing the same month the server would.CalendarMonth.GridDayscomputesweeks = (span + 6) / 7wherespan = WeekdayIndex(first) + daysInMonth, andWeekdayIndexis((int)DayOfWeek + 6) % 7(Monday-first). The test'sMath.ceil((offset + days) / 7)withoffset = (first.getUTCDay() + 6) % 7is the exact same formula, so the six-week month the test locates is guaranteed to match production.createDatedCard/dayThisMonthadded toboards.spec.jsare a verbatim copy of the ones already incalendar.spec.js, consistent with this suite's existing convention of each spec file being self-contained (no shared helpers module).deleteCard'sbutton:has-text("Delete")thenbutton:has-text("Yes, delete")sequence looked at first like it could hit Playwright's strict-mode multi-match (sincehas-textis substring matching and "Yes, delete" contains "delete"), butCardModal.razorrenders the two states via mutually exclusive@if/@elseblocks, so only one match ever exists at a time — and the same two-line pattern is already used identically inboard.spec.js,boards.spec.js(existing test),share.spec.js, andcalendar-all.spec.js./board/{id}(confirmed by tracing the test flow), socreateDatedCardoperates on the right board, and the calendar navigation afterward switches to that same board's calendar.document.getAnimations().forEach(a => a.finish())addition directly targets the described entrance-animation race in the overflow measurement, with atry/catchcorrectly guarding againstfinish()throwing on non-finite animations.No correctness issues found. The docs update is a scoped addition to the existing fresh-stack paragraph and remains accurate. This is a well-verified fix — good to merge.
⏱ 1m 31s · 17 turns · tokens: 29.2k in / 6.5k out (+765.7k cache-read)
📜 Full session transcript