From ccbd66d3d94c46689f5a919daecf46bd447a49df Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Tue, 9 Jun 2026 12:55:30 +0200 Subject: [PATCH] test(e2e): retry supersync time-estimate dialog until input binds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fill('10m') could fire its `input` event before the duration input's value-accessor (an `input` HostListener) was wired, so the typed value never reached the model and submit() saved an empty time — the panel stayed "-/-" and toContainText('10m') timed out (scheduled run 27197862391, SuperSync 1/6). Retry the whole open→fill→submit cycle so a fill that didn't stick is re-applied once the control binds. --- .../sync/supersync-daily-summary.spec.ts | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/e2e/tests/sync/supersync-daily-summary.spec.ts b/e2e/tests/sync/supersync-daily-summary.spec.ts index f2ff97d4cd..c986363bb0 100644 --- a/e2e/tests/sync/supersync-daily-summary.spec.ts +++ b/e2e/tests/sync/supersync-daily-summary.spec.ts @@ -67,27 +67,28 @@ test.describe('@supersync Daily Summary Sync', () => { const panel = clientA.page.locator('task-detail-panel'); await expect(panel).toBeVisible(); - // 2. Click time item to open dialog - // Look for the item with the time-estimate icon + // 2. Open the time-estimate dialog, set "Time Spent", and submit. + // Retry the whole open→fill→submit cycle: a fill() on a freshly-opened + // dialog can fire its `input` event before the duration input's + // value-accessor (an `input` HostListener) is wired, so the typed value + // never reaches the model and an empty time is saved (panel stays "-/-"). + // Reopening on retry re-fills once the control is bound. const timeItem = panel.locator( 'task-detail-item:has(mat-icon:text("hourglass_empty"))', ); - await timeItem.click(); - - // 3. Wait for dialog - const dialog = clientA.page.locator('dialog-time-estimate'); - await expect(dialog).toBeVisible(); - - // 4. Fill time spent (assuming first input is time spent or allow flexible input) - // Usually the dialog focuses the relevant input or has labeled inputs. - // We'll try filling the first input found in the dialog. - const timeInput = dialog.locator('input').first(); - await timeInput.fill('10m'); - await clientA.page.keyboard.press('Enter'); - - // 5. Verify update in panel - // The time item should now show 10m - await expect(timeItem).toContainText('10m'); + const pageA = clientA.page; + const dialog = pageA.locator('dialog-time-estimate'); + await expect(async () => { + if (!(await dialog.isVisible())) { + await timeItem.click(); + await expect(dialog).toBeVisible(); + } + // First input is "Time Spent"; the panel item shows timeSpent / estimate. + await dialog.locator('input').first().fill('10m'); + await pageA.keyboard.press('Enter'); + await expect(dialog).toBeHidden({ timeout: 2000 }); + await expect(timeItem).toContainText('10m', { timeout: 2000 }); + }).toPass({ timeout: 30000 }); console.log('Client A manually set time to: 10m'); // Create Task B (no time)