From d72af4437375fd17631767af83b3dd1f3f4c9ac2 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Mon, 30 Nov 2026 16:51:12 -0500 Subject: [PATCH] test: wait for the import scan before checking Eject on a removable drive The import dialog marks the source row as selected before it scans the folder, and only sets Eject visibility once the scan result is written. The window test checked Eject right after the row was marked, so it failed whenever the scan response arrived late. Wait for the scan status instead. --- frontend/tests/window/test_window.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/tests/window/test_window.py b/frontend/tests/window/test_window.py index 3827538..525a0ee 100644 --- a/frontend/tests/window/test_window.py +++ b/frontend/tests/window/test_window.py @@ -339,6 +339,8 @@ def listing(route): eject = page.locator(".fl-imp-eject") eject.wait_for(state="attached", timeout=15_000) page.wait_for_function("() => document.querySelector('.fl-imp-row.is-on')?.dataset.path === 'E:\\\\'", timeout=15_000) + # The dialog marks the source row before it scans; Eject is set in the same step that writes the scan result, so wait for that. + page.wait_for_function("() => document.querySelector('.fl-imp-status')?.textContent === '0 photos'", timeout=15_000) visible = eject.is_visible() browser.close() assert visible, "Eject after import stayed hidden on a removable Windows drive"