Skip to content

Commit d42fdfe

Browse files
renemadsenclaude
andcommitted
fix(test-j): wait for payroll settings response before clicking auto-break toggle
The payroll integration section on the settings page makes an async getPayrollSettings() call that triggers a re-render after the main settings GET completes. If the auto-break toggle is clicked during that re-render, the click doesn't register. Wait for the payroll settings response + 500ms settle before interacting with the toggle. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cc7449e commit d42fdfe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ test.describe('Dashboard edit values', () => {
2626
await page.locator('#plugin-settings-link0').click();
2727
await settingsGetPromise;
2828

29+
// Wait for payroll settings to finish loading (async call that causes re-render)
30+
await page.waitForResponse(
31+
r => r.url().includes('/api/time-planning-pn/payroll/settings') && r.request().method() === 'GET'
32+
).catch(() => {});
33+
await page.waitForTimeout(500);
34+
2935
// Check autoBreakCalculationActiveToggle state and enable if needed
3036
const toggleBtn = page.locator('#autoBreakCalculationActiveToggle button[role="switch"]');
3137
const isChecked = await toggleBtn.getAttribute('aria-checked');

0 commit comments

Comments
 (0)