Skip to content

Commit a9bf842

Browse files
renemadsenclaude
andcommitted
fix(f1m): use boundary-case pause for actualPauseTooLong validator
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>
1 parent d7b48c6 commit a9bf842

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

eform-client/playwright/e2e/plugins/time-planning-pn/f1m/dashboard-edit-a.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,11 @@ test.describe('Dashboard edit values (f1m, flag-on, off-grid validation pairs)',
178178
});
179179

180180
test('should show an error when actual pause is longer than the shift duration', async ({ page }) => {
181-
// 10:31 - 08:13 = 138 min shift duration; 02:47 = 167 min pause.
182-
// 167 ≥ 138 ⇒ `breakTooLong` validator fires the same as the legacy
183-
// f-shard pair (10:00-08:00 / 02:00 = 120 ≥ 120).
181+
// 10:31 - 08:13 = 138 min shift duration; pause 02:18 = 138 min.
182+
// 138 ≥ 138 ⇒ `breakTooLong` validator fires (same boundary case as
183+
// legacy f-shard pair 8:00-10:00 / 2:00 ⇒ 120 ≥ 120). The pause
184+
// input's `[max]=getMaxDifference(start,stop)` caps the picker at the
185+
// shift duration, so we pick AT the cap to trigger the validator.
184186
const t = OFFGRID_TIMES_F1M.actualPauseTooLong;
185187
await setTimepickerValue(page, 'start1StartedAt', t.start);
186188
await setTimepickerValue(page, 'stop1StoppedAt', t.stop);

eform-client/playwright/helpers/one-minute-times.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,14 @@ export const OFFGRID_TIMES_F1M = {
140140
plannedSameTime: { start: '09:43', stop: '09:43' },
141141
// Actual: stop-before-start (11:29 > 09:11), pause kept at 00:00.
142142
actualStopBefore: { start: '11:29', stop: '09:11', pause: '00:00' },
143-
// Actual: pause longer than shift duration. 10:31 - 08:13 = 138 min;
144-
// pause = 02:47 = 167 min ≥ 138 ⇒ trips `breakTooLong` validator.
145-
actualPauseTooLong: { start: '08:13', stop: '10:31', pause: '02:47' },
143+
// Actual: pause equal to shift duration (boundary case). 10:31 - 08:13 =
144+
// 138 min; pause = 02:18 = 138 min ⇒ `breakMin >= duration` (138 ≥ 138)
145+
// trips `breakTooLong`. Mirrors the legacy `f` shard which uses pause =
146+
// shift-duration exactly (8:00-10:00 / 2:00 ⇒ 120 ≥ 120). The pause
147+
// input has `[max]=getMaxDifference(start,stop)` so the timepicker caps
148+
// selection at the duration; picking AT the max equals the boundary
149+
// and fires the validator. Off-grid: 18 mod 5 = 3 ≠ 0.
150+
actualPauseTooLong: { start: '08:13', stop: '10:31', pause: '02:18' },
146151
// Actual: same-start-stop (both 09:43, both nonzero), pause 00:00.
147152
actualSameTime: { start: '09:43', stop: '09:43', pause: '00:00' },
148153
// Math: midnight → off-grid hour. 00:00 → 02:24 ⇒ 144 min plan ⇒ 2.4 h.

0 commit comments

Comments
 (0)