fix(e2e): stabilize flaky LWW delete vs update race test

Replace racy :focus selector with explicit visibility wait and focus()
call. The original selector failed intermittently because Angular sets
focus asynchronously via change detection.
This commit is contained in:
Johannes Millan 2026-01-15 10:54:21 +01:00
parent 446a051169
commit 305372eb23

View file

@ -1333,11 +1333,13 @@ test.describe('@supersync SuperSync LWW Conflict Resolution', () => {
const taskLocatorB = clientB.page
.locator(`task:not(.ng-animating):has-text("${taskName}")`)
.first();
await taskLocatorB.waitFor({ state: 'visible', timeout: 5000 });
await taskLocatorB.dblclick();
const titleInputB = clientB.page.locator(
'input.mat-mdc-input-element:focus, textarea:focus',
);
const titleInputB = clientB.page
.locator('input.mat-mdc-input-element, textarea')
.first();
await titleInputB.waitFor({ state: 'visible', timeout: 5000 });
await titleInputB.focus();
await titleInputB.fill(`${taskName}-Updated`);
await clientB.page.keyboard.press('Enter');
await clientB.page.waitForTimeout(300);