diff --git a/src/app/components/date-comparison/date-comparison.spec.ts b/src/app/components/date-comparison/date-comparison.spec.ts index 57e3efb..6dc1cb9 100644 --- a/src/app/components/date-comparison/date-comparison.spec.ts +++ b/src/app/components/date-comparison/date-comparison.spec.ts @@ -447,6 +447,10 @@ describe('DateComparison', () => { fixture.detectChanges(); expect(document.querySelector('.comparison-loading')).not.toBeNull(); expect(comparison.failed()).toBe(false); + // The dialog focuses its title only after its opening animation; let that settle first. + await vi.waitFor(() => + expect(document.activeElement).toBe(document.getElementById('counterfactual-title')), + ); const focusedBeforeResult = document.activeElement; (await job(2)).emit({ type: 'counterfactual-result',