Skip to content

Phase 5 PR 5: f1m playwright variant — UseOneMinuteIntervals=true#1551

Merged
renemadsen merged 2 commits into
stablefrom
feat/use-one-minute-intervals-phase-5-pr5-f1m
May 3, 2026
Merged

Phase 5 PR 5: f1m playwright variant — UseOneMinuteIntervals=true#1551
renemadsen merged 2 commits into
stablefrom
feat/use-one-minute-intervals-phase-5-pr5-f1m

Conversation

@renemadsen
Copy link
Copy Markdown
Member

Summary

  • Adds the f1m shard to the playwright variant matrix exercising UseOneMinuteIntervals=true. Where b1m / c1m / d1m / e1m clone the positive-path multi-shift round-trip from b/, f1m clones the SAVE-FAILURE / validation suite from f/dashboard-edit-a.spec.ts.
  • Validation tests use off-grid (non-multiple-of-5) time pairs that preserve the same invalid relationships (stop < start, start === stop, pause >= duration) the legacy f shard relies on — guarding that the plannedShiftDurationValidator / actualShiftDurationValidator keep operating on raw HH:mm form values regardless of the storage-side 5-min quantization.
  • Two midnight-wrap math tests use an off-grid pair 00:00 ↔ 02:24 (144 min / 1296 min) so the recomputed planHours lands on a clean fractional value (2.4 / 21.6); todaysFlex stays '0.00' because actual quantization round-trips symmetrically at this pair.
  • New OFFGRID_TIMES_F1M block in eform-client/playwright/helpers/one-minute-times.ts keeps the off-grid literals in the canonical helper next to the existing b1m / c1m / d1m / e1m blocks. Two test.skip(...) cases are preserved as .skip so the file remains a structural mirror of f/dashboard-edit-a.spec.ts.
  • Workflow matrix updated in both dotnet-core-pr.yml and dotnet-core-master.yml.

Test plan

  • CI green on feat/use-one-minute-intervals-phase-5-pr5-f1m — full matrix including the new f1m shard plus the existing 22 entries.
  • f1m shard'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 to 2.4 / 21.6).
  • Existing b1m / c1m / d1m / e1m shards still pass (pattern unchanged).
  • Parent f shard still passes (no shared seed or test changes).

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 3, 2026 18:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_F1M helper data for off-grid validation and midnight-wrap test cases.
  • Add a new f1m Playwright 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 f1m shard.

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>
@renemadsen renemadsen merged commit 9067725 into stable May 3, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants