Phase 5 PR 5: f1m playwright variant — UseOneMinuteIntervals=true#1551
Merged
Conversation
Adds the `f1m` shard to the variant matrix exercising the flag-on (`UseOneMinuteIntervals=1`) rendering / form / picker code paths. Where b1m / c1m / d1m / e1m clone the positive-path multi-shift round-trip from the `b` shard, f1m clones the SAVE-FAILURE / validation suite from `f/dashboard-edit-a.spec.ts`. Each negative-path test fills shift 1 with an invalid time pair (stop-before-start, same start/stop, pause longer than shift) and asserts the corresponding validator surfaces its Danish error message — guarding the contract that `plannedShiftDurationValidator` / `actualShiftDurationValidator` operate on raw `HH:mm` form values via `getMinutes()` and therefore MUST trigger identical errors regardless of the storage-side 5-min quantization. Mirrors the merged b1m / c1m / d1m / e1m pattern shipped by PR #1545 / PR #1548 / PR #1549 / PR #1550: • Same baseline seed (`420_eform-angular-time-planning-plugin.sql` and `420_SDK.sql` are copies of `a/`). • Same `post-migration.sql` flipping `UseOneMinuteIntervals = 1` for every active assigned site (the workflow's generic post-migration step picks this up automatically). What's new in f1m: a dedicated `OFFGRID_TIMES_F1M` block in the shared `one-minute-times.ts` helper that pairs each validation case with off-grid (non-multiple-of-5) minutes which still preserve the same INVALID RELATIONSHIP that the legacy `f`-shard test relied on. E.g. `'10:23' > '09:17'` trips `invalidRange` exactly the same way `'10:00' > '09:00'` does in the parent shard. The two midnight-wrap math tests use an off-grid pair `00:00 ↔ 02:24` (144 min one way, 1296 min the other) so the recomputed `planHours` lands on a clean fractional value (`2.4` / `21.6`) rather than the integer `2` / `22` the legacy `f` shard asserted; `todaysFlex` stays `'0.00'` because actual quantization (still 5-min internally for the storage path) round-trips symmetrically with the planned value at this exact pair. Arithmetic justification is inlined on each test. The two `test.skip(...)` cases for break-too-long-on-planned and shift2-overlapping-shift1 are preserved as `.skip` so the file remains a structural mirror of the parent `f/dashboard-edit-a.spec.ts`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new f1m Playwright shard to exercise the UseOneMinuteIntervals=true path for the time-planning dashboard’s validation-focused f scenarios. It extends the existing flag-on shard matrix by introducing off-grid time fixtures, a dedicated negative-path spec, and workflow entries so CI runs the new variant alongside the other Playwright shards.
Changes:
- Add
OFFGRID_TIMES_F1Mhelper data for off-grid validation and midnight-wrap test cases. - Add a new
f1mPlaywright shard with a post-migration SQL patch and a cloned validation-oriented dashboard spec. - Extend PR and master CI workflow matrices to execute the new
f1mshard.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
eform-client/playwright/helpers/one-minute-times.ts |
Adds shared off-grid fixture values for the new f1m shard. |
eform-client/playwright/e2e/plugins/time-planning-pn/f1m/post-migration.sql |
Enables UseOneMinuteIntervals for the shard’s seeded assigned sites after migration. |
eform-client/playwright/e2e/plugins/time-planning-pn/f1m/dashboard-edit-a.spec.ts |
Adds the new off-grid validation and midnight-wrap Playwright coverage for the f1m shard. |
.github/workflows/dotnet-core-pr.yml |
Adds f1m to the PR Playwright matrix. |
.github/workflows/dotnet-core-master.yml |
Adds f1m to the master Playwright matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+229
to
+230
| await expect(page.locator('#planHours')).toHaveValue(OFFGRID_TIMES_F1M.midnightToHoursPlan); | ||
| await expect(page.locator('#todaysFlex')).toHaveValue(OFFGRID_TIMES_F1M.zeroFlex); |
Comment on lines
+236
to
+244
| // actualMin = (289 - 29.8) * 5 = 1296 ⇒ actualHours = 21.6. | ||
| // todaysFlex = 21.6 - 21.6 = 0.00. | ||
| const t = OFFGRID_TIMES_F1M.hoursToMidnight; | ||
| await setTimepickerValue(page, 'plannedStartOfShift1', t.start); | ||
| await setTimepickerValue(page, 'plannedEndOfShift1', t.stop); | ||
| await setTimepickerValue(page, 'start1StartedAt', t.start); | ||
| await setTimepickerValue(page, 'stop1StoppedAt', t.stop); | ||
| await expect(page.locator('#planHours')).toHaveValue(OFFGRID_TIMES_F1M.hoursToMidnightPlan); | ||
| await expect(page.locator('#todaysFlex')).toHaveValue(OFFGRID_TIMES_F1M.zeroFlex); |
The pause input has `[max]=getMaxDifference(start,stop)` which caps the ngx-material-timepicker at the shift duration. Picking 02:47 against shift 08:13-10:31 (cap = 02:18) was clamped, so the breakTooLong validator never fired and the test timed out waiting for pause1Id-Error. Switch to pause = 02:18 (boundary, off-grid: 18 mod 5 = 3) so the picker accepts it AND `breakMin >= duration` (138 >= 138) trips the validator. Mirrors the legacy `f` shard which already uses pause = shift-duration exactly (8:00-10:00 / 2:00). Co-Authored-By: Claude Opus 4.7 (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.
Summary
f1mshard to the playwright variant matrix exercisingUseOneMinuteIntervals=true. Where b1m / c1m / d1m / e1m clone the positive-path multi-shift round-trip fromb/, f1m clones the SAVE-FAILURE / validation suite fromf/dashboard-edit-a.spec.ts.stop < start,start === stop,pause >= duration) the legacyfshard relies on — guarding that theplannedShiftDurationValidator/actualShiftDurationValidatorkeep operating on rawHH:mmform values regardless of the storage-side 5-min quantization.00:00 ↔ 02:24(144 min / 1296 min) so the recomputedplanHourslands on a clean fractional value (2.4/21.6);todaysFlexstays'0.00'because actual quantization round-trips symmetrically at this pair.OFFGRID_TIMES_F1Mblock ineform-client/playwright/helpers/one-minute-times.tskeeps the off-grid literals in the canonical helper next to the existing b1m / c1m / d1m / e1m blocks. Twotest.skip(...)cases are preserved as.skipso the file remains a structural mirror off/dashboard-edit-a.spec.ts.dotnet-core-pr.ymlanddotnet-core-master.yml.Test plan
feat/use-one-minute-intervals-phase-5-pr5-f1m— full matrix including the newf1mshard plus the existing 22 entries.f1mshard's seven non-skipped tests all pass against the flag-on form (off-grid times still trip the same Danish validator messages; midnight-wrap math computes to2.4/21.6).b1m/c1m/d1m/e1mshards still pass (pattern unchanged).fshard still passes (no shared seed or test changes).🤖 Generated with Claude Code