fix(test): assert a robust node in MailboxScreenTest empty-state-gate test
emptyState_isHidden_whileTheInboxPagerIsStillLoading asserted the compose FAB with assertIsDisplayed(), but MailboxScreen renders no loading affordance in this exact scenario (isSyncingFolder only flips true from selectFolder(), which this test never calls), so there is nothing else guaranteed visible while refresh == Loading. The FAB is unconditionally composed in Scaffold's floatingActionButton slot regardless of loading state, so its role here is only to prove the screen composed rather than crashing or rendering blank. Swap to assertExists(), which checks presence in the semantics tree without requiring on-screen visibility, and keep the core assertion (mailbox_empty assertDoesNotExist()) that verifies the actual issue #219 behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -306,8 +306,13 @@ class MailboxScreenTest {
|
||||
)
|
||||
setContent(FakeMailRepository(pagedOverride = loadingEmpty))
|
||||
|
||||
// The screen has composed (its compose FAB shows), but the empty state stays gated off.
|
||||
composeTestRule.onNodeWithText(string(R.string.action_compose)).assertIsDisplayed()
|
||||
// The screen has composed (its compose FAB is present in the tree) rather than having crashed
|
||||
// or rendered blank — that's the sanity check here, not the FAB's on-screen visibility. This
|
||||
// scenario has no other loading affordance to point at instead: isSyncingFolder (the spinner
|
||||
// gate below) only applies to a per-folder background sync started by selectFolder(), which
|
||||
// this test never calls, so nothing else is guaranteed visible while refresh == Loading.
|
||||
// assertExists() rather than assertIsDisplayed() for that reason — the FAB isn't under test here.
|
||||
composeTestRule.onNodeWithText(string(R.string.action_compose)).assertExists()
|
||||
composeTestRule.onNodeWithText(string(R.string.mailbox_empty)).assertDoesNotExist()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user