From 33dfb705767c2b622a06048d039df039e952eb85 Mon Sep 17 00:00:00 2001 From: S Plotnikov Date: Fri, 28 Aug 2026 18:09:49 +0200 Subject: [PATCH] test: fix undo-restore flow test stranded on ManageShelvesScreen The nightly instrumented run has failed on undo_restores_a_shelf_deleted_with_the_keep_products_strategy since the Storage rework moved shelf editing (and the undo snackbar) off the tabbed LocationDetailScreen onto ManageShelvesScreen: after Undo the test tapped 'Top shelf' on the manage screen, where products are never rendered, and timed out waiting for 'Milk'. Navigate back to the location detail after the restore, as a user would, and assert the product there. Verified on-device: all 4 tests in the class pass. Claude-Session: https://claude.ai/code/session_01DgpTaTHThASmowZxsvHPfn --- .../inventory/flow/DeleteShelfStrategyFlowTest.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/androidTest/java/dev/scuttle/inventory/flow/DeleteShelfStrategyFlowTest.kt b/app/src/androidTest/java/dev/scuttle/inventory/flow/DeleteShelfStrategyFlowTest.kt index 2187cf8..14e84b5 100644 --- a/app/src/androidTest/java/dev/scuttle/inventory/flow/DeleteShelfStrategyFlowTest.kt +++ b/app/src/androidTest/java/dev/scuttle/inventory/flow/DeleteShelfStrategyFlowTest.kt @@ -285,13 +285,15 @@ class DeleteShelfStrategyFlowTest : FlowTestBase() { Thread.sleep(2_000) waitForIdle() - // The shelf is back, and — the actual guarantee — so is its product. - // Re-select the restored tab explicitly: the pane's shelf selection was - // cleared when the list emptied on delete, so the restored shelf's - // products aren't shown until its tab is tapped (as a user would). + // The shelf is back in the manage list. Products are never rendered on + // ManageShelvesScreen (editing moved here in the Storage rework; the + // tabbed products pager stayed on LocationDetailScreen), so navigate + // back — as a user would — and verify the restored shelf's tab shows + // its product again there. waitUntilAtLeastOneExists(hasText("Top shelf"), timeoutMillis = 5_000) - onAllNodesWithText("Top shelf")[0].performClick() + onNodeWithContentDescription("Back").performClick() waitForIdle() + waitUntilAtLeastOneExists(hasText("Top shelf"), timeoutMillis = 5_000) waitUntilAtLeastOneExists(hasText("Milk"), timeoutMillis = 5_000) } }