-
Notifications
You must be signed in to change notification settings - Fork 927
All tests should assert if a value is displayed #6153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| composeTestRule.onNodeWithText("Email").assertDoesNotExist() | ||
| composeTestRule.onNodeWithText("Authenticator App").isDisplayed() | ||
| composeTestRule.onNodeWithText("Authenticator app").assertIsDisplayed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was checking for inaccurate text previously but without the assertion, it was still passing
|
Claude finished @david-livefront's task —— View job Overall Assessment: APPROVE This PR correctly converts non-asserting display checks to proper assertions, improving test reliability by ensuring visibility checks actually fail when elements aren't in the expected state. Key FindingsFinding 1: Test was checking incorrect text without assertions - now fixed The TwoFactorLoginScreenTest was checking for "Authenticator App" (capital 'A') without asserting, so it passed despite the actual UI showing "Authenticator app" (lowercase 'a'). Both the assertion and text are now correct. Finding 2: Semantic change from isNotDisplayed to assertIsDisplayed needs verification FoldersScreenTest.kt:114 changed from checking the empty state is NOT displayed to asserting it IS displayed. Based on test context, this appears correct, but please verify as it's a behavioral change beyond just adding assertions. Finding 3: Test removed entirely rather than fixed VerifyPasswordScreenTest had a test for password visibility toggling that was removed rather than fixed with proper assertions. Consider whether this functionality still needs test coverage. See inline comments for details on each finding. |
| composeTestRule | ||
| .onNodeWithText("There are no folders to list.") | ||
| .isNotDisplayed() | ||
| .assertIsDisplayed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was backwards, this text should be displayed when the list is empty.
...c/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/twofactorlogin/TwoFactorLoginScreenTest.kt
Show resolved
Hide resolved
| "security policy may restrict importing items from Bitwarden to another app." | ||
| composeTestRule | ||
| .onNodeWithText( | ||
| text = "You don't have any accounts you can import from.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard to tell here but this uses a quote and should have had a curly quote.
...rc/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/folders/FoldersScreenTest.kt
Show resolved
Hide resolved
.../com/x8bit/bitwarden/ui/vault/feature/exportitems/verifypassword/VerifyPasswordScreenTest.kt
Show resolved
Hide resolved
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6153 +/- ##
=======================================
Coverage 84.99% 84.99%
=======================================
Files 723 723
Lines 52740 52740
Branches 7649 7649
=======================================
Hits 44824 44824
Misses 5243 5243
Partials 2673 2673 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

🎟️ Tracking
N/A
📔 Objective
This PR cleans up a bunch of tests that were using
isDisplayed()andisNotDisplayed()instead of theassertisDisplayed()andassertIsNotDisplayed(). This change ensures the tests are properly checking if the item is in fact visible or not.⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes