Skip to content

Commit ef84a80

Browse files
renemadsenclaude
andcommitted
fix(playwright): enable shifts 3-5 on assigned site before multishift test
The workday-entity dialog only renders shift rows 3-5 when thirdShiftActive/fourthShiftActive/fifthShiftActive are true on the assigned site. CI defaults them to false, so the test timed out waiting for [data-testid="plannedStartOfShift3"]. Open the assigned-site dialog via #firstColumn0 first and tick the three cascading checkboxes, then proceed with the day-cell edit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 937f939 commit ef84a80

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

eform-client/playwright/e2e/plugins/time-planning-pn/b/dashboard-edit-multishift.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,30 @@ test.describe('Dashboard — multi-shift (3-5) round-trip regression guard', ()
100100
await indexPromise;
101101
await waitForSpinner(page);
102102

103+
// Shifts 3-5 are only rendered in the workday-entity dialog when the
104+
// assigned site has thirdShiftActive / fourthShiftActive / fifthShiftActive
105+
// flipped on (see workday-entity-dialog.component.ts:354-363). CI seed
106+
// defaults them all to false, so we open the assigned-site dialog first
107+
// and enable the three cascading checkboxes before editing the day.
108+
await page.locator('#firstColumn0').click();
109+
await expect(page.locator('mat-dialog-container')).toBeVisible({ timeout: 10000 });
110+
111+
for (const id of ['#thirdShiftActive', '#fourthShiftActive', '#fifthShiftActive']) {
112+
const cb = page.locator(`${id} input[type="checkbox"]`);
113+
await cb.waitFor({ state: 'attached', timeout: 10000 });
114+
if (!(await cb.isChecked())) {
115+
await page.locator(id).click({ force: true });
116+
}
117+
await expect(cb).toBeChecked();
118+
}
119+
120+
const assignSitePromise = page.waitForResponse(
121+
r => r.url().includes('/api/time-planning-pn/settings/assigned-site') && r.request().method() === 'PUT');
122+
await page.locator('#saveButton').click({ force: true });
123+
await assignSitePromise;
124+
await waitForSpinner(page);
125+
await expect(page.locator('mat-dialog-container')).toHaveCount(0, { timeout: 10000 });
126+
103127
// Pick any visible day cell — column 3 (worker index), first date in the range.
104128
const cellId = '#cell3_0';
105129
await page.locator(cellId).scrollIntoViewIfNeeded();

0 commit comments

Comments
 (0)