From 7d9d8de967c64385159d1bef6cec2b5be5e00046 Mon Sep 17 00:00:00 2001 From: Richard R Date: Mon, 6 Apr 2026 11:16:54 -0600 Subject: [PATCH] test(ui): stabilize onboarding/modal dismissal in e2e helpers Refactor test helpers to reliably dismiss onboarding and migration modals during UI flows. Replace ad-hoc Settings-only dismissal with a unified dismissOnboardingModals routine that targets privacy, migration, and settings dialogs via testids, interacts with visible controls (checkbox, continue/skip/save buttons) and waits for dialogs to hide. Increase resilience by repeating checks, adding short settle delays, and tightening timeouts. Also add data-testid attributes to PrivacyModal, SettingsModal and DexieMigrationModal to make the selectors deterministic and reduce flakiness in export/upload tests. No production behavior changes. --- src/components/PrivacyModal.tsx | 4 +- src/components/SettingsModal.tsx | 3 +- .../documents/DexieMigrationModal.tsx | 3 +- tests/helpers.ts | 118 ++++++++---------- 4 files changed, 61 insertions(+), 67 deletions(-) diff --git a/src/components/PrivacyModal.tsx b/src/components/PrivacyModal.tsx index 1ea6746..5909cbc 100644 --- a/src/components/PrivacyModal.tsx +++ b/src/components/PrivacyModal.tsx @@ -96,7 +96,7 @@ export function PrivacyModal({ onAccept }: PrivacyModalProps) { leaveFrom="opacity-100 scale-100" leaveTo="opacity-0 scale-95" > - +