Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ test.describe('Dashboard edit values', () => {
const settingsGetPromise = page.waitForResponse(
r => r.url().includes('/api/time-planning-pn/settings') && r.request().method() === 'GET'
);
// Registered before the click alongside settingsGetPromise: getSettings() and
// getPayrollSettings() both fire synchronously from ngOnInit, so listening for
// this response only after settingsGetPromise resolves is too late — the
// payroll request has often already completed, leaving this promise unresolved
// until the 120s test timeout (no default action timeout is configured).
const payrollSettingsGetPromise = page.waitForResponse(
r => r.url().includes('/api/time-planning-pn/payroll/settings') && r.request().method() === 'GET'
);
await page.locator('#plugin-settings-link0').click();
await settingsGetPromise;

// Wait for payroll settings to finish loading (async call that causes re-render)
await page.waitForResponse(
r => r.url().includes('/api/time-planning-pn/payroll/settings') && r.request().method() === 'GET'
).catch(() => {});
await payrollSettingsGetPromise;
await page.waitForTimeout(500);

// Check autoBreakCalculationActiveToggle state and enable if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@ test.describe('Dashboard edit values (j1m, flag-on, global values round-trip)',
const settingsGetPromise = page.waitForResponse(
r => r.url().includes('/api/time-planning-pn/settings') && r.request().method() === 'GET'
);
// Registered before the click alongside settingsGetPromise: getSettings() and
// getPayrollSettings() both fire synchronously from ngOnInit, so listening for
// this response only after settingsGetPromise resolves is too late — the
// payroll request has often already completed, leaving this promise unresolved
// until the 120s test timeout (no default action timeout is configured).
const payrollSettingsGetPromise = page.waitForResponse(
r => r.url().includes('/api/time-planning-pn/payroll/settings') && r.request().method() === 'GET'
);
await page.locator('#plugin-settings-link0').click();
await settingsGetPromise;

// Wait for payroll settings to finish loading (async call that causes re-render)
await page.waitForResponse(
r => r.url().includes('/api/time-planning-pn/payroll/settings') && r.request().method() === 'GET'
).catch(() => {});
await payrollSettingsGetPromise;
await page.waitForTimeout(500);

// Check autoBreakCalculationActiveToggle state and enable if needed
Expand Down
Loading