Skip to content

Commit 489147c

Browse files
renemadsenclaude
andcommitted
fix(playwright): register index response listener before save click
The waitForResponse for the Index POST was registered after awaiting the PUT response, creating a race where the Index response could arrive before the listener was set up — causing the test to miss it and assert against a half-rendered dashboard. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1a63029 commit 489147c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ test.describe('Dashboard edit values', () => {
369369

370370
// Save
371371
const updateDayPromise = page.waitForResponse(r => r.url().includes('/api/time-planning-pn/plannings/') && r.request().method() === 'PUT');
372+
const indexUpdatePromise2 = page.waitForResponse(r => r.url().includes('/api/time-planning-pn/plannings/index') && r.request().method() === 'POST');
372373
await page.locator('#saveButton').click();
373374
await updateDayPromise;
374-
const indexUpdatePromise2 = page.waitForResponse(r => r.url().includes('/api/time-planning-pn/plannings/index') && r.request().method() === 'POST');
375375
await indexUpdatePromise2;
376376
await waitForSpinner(page);
377377
await page.waitForTimeout(1000);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ test.describe('Dashboard edit values', () => {
307307

308308
// Save
309309
const updateDayPromise = page.waitForResponse(r => r.url().includes('/api/time-planning-pn/plannings/') && r.request().method() === 'PUT');
310+
const indexUpdatePromise2 = page.waitForResponse(r => r.url().includes('/api/time-planning-pn/plannings/index') && r.request().method() === 'POST');
310311
await page.locator('#saveButton').click();
311312
await updateDayPromise;
312-
const indexUpdatePromise2 = page.waitForResponse(r => r.url().includes('/api/time-planning-pn/plannings/index') && r.request().method() === 'POST');
313313
await indexUpdatePromise2;
314314
await waitForSpinner(page);
315315
await page.waitForTimeout(1000);

0 commit comments

Comments
 (0)