fix(e2e): fix schedule dialog submit button selector

The selector 'button:last-child' caused a Playwright strict mode
violation by matching multiple buttons (Schedule and Cancel).
Changed to 'button[color="primary"]' to specifically target the
primary action button.

Fixes 5 failing reminder tests that were unable to schedule tasks.
This commit is contained in:
Johannes Millan 2026-01-20 21:12:02 +01:00
parent 269eb9952a
commit 9c5704c6c1

View file

@ -11,7 +11,7 @@ const DETAIL_PANEL_SCHEDULE_ITEM =
'task-detail-item:has(mat-icon:text("schedule"))';
const RIGHT_PANEL = '.right-panel';
const DIALOG_CONTAINER = 'mat-dialog-container';
const DIALOG_SUBMIT = 'mat-dialog-actions button:last-child';
const DIALOG_SUBMIT = 'mat-dialog-actions button[color="primary"]';
/**
* Closes the task detail panel if it's currently open.
@ -74,7 +74,7 @@ export const scheduleTaskViaDetailPanel = async (
// Fill time input
await fillTimeInput(page, scheduleTime);
// Submit dialog
// Submit dialog - click the primary action button (Schedule button)
const submitBtn = page.locator(DIALOG_SUBMIT);
await submitBtn.waitFor({ state: 'visible', timeout: 5000 });
await submitBtn.click();