From ce7ec0a88f4e6f494f953a71f0f81036fb3ff2de Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Thu, 11 Jun 2026 23:41:56 +0200 Subject: [PATCH] Move missing evidence sheet dismissal --- tests/helpers/addObsBottomSheet.js | 16 ++++++++++++++++ .../navigation/MyObservations.test.js | 3 --- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/helpers/addObsBottomSheet.js b/tests/helpers/addObsBottomSheet.js index 880f0fa74..4f2bde292 100644 --- a/tests/helpers/addObsBottomSheet.js +++ b/tests/helpers/addObsBottomSheet.js @@ -141,10 +141,26 @@ export async function navigateToSuggestionsViaAICameraFromMyObs() { await navigateToAICameraFromMyObs( ); await takeAICameraPhotoAndOpenSuggestions( ); } + async function pressObsEditSaveButton() { await actor.press( await screen.findByTestId( "ObsEdit.saveButton" ) ); } + +/** Dismisses TextSheet confirmations (missing evidence, imprecise location). */ +async function confirmObsEditWarningSheets() { + for ( let attempt = 0; attempt < 2; attempt += 1 ) { + try { + const okButton = await screen.findByText( "OK", {}, { timeout: 2_000 } ); + await actor.press( okButton ); + await pressObsEditSaveButton(); + } catch { + break; + } + } +} + /** Saves on ObsEdit, confirming warning sheets when they appear, then waits for My Obs. */ export async function saveObsEditObservation( options = {} ) { await pressObsEditSaveButton(); + await confirmObsEditWarningSheets(); } diff --git a/tests/integration/navigation/MyObservations.test.js b/tests/integration/navigation/MyObservations.test.js index 9fd32e473..887990047 100644 --- a/tests/integration/navigation/MyObservations.test.js +++ b/tests/integration/navigation/MyObservations.test.js @@ -176,9 +176,6 @@ describe( "MyObservations -> ObsEdit no evidence -> MyObservations", ( ) => { await waitForDisplayedText( /1 observation uploaded/ ); await pressButtonByLabel( /Add observations/ ); await pressButtonByLabel( /Observation with no evidence/ ); - // missing evidence sheet pops up here, so need to press SAVE twice - await pressButtonByText( "OK" ); - await pressButtonByText( /SAVE/ ); // await navigateToPhotoImporterFromMyObs(); await saveObsEditObservation(); await waitForDisplayedText( /Upload 3 observations/, 5000 );