Created
July 17, 2023 14:48
-
-
Save zurche/d1cee9bd3bbddfe756de64caed94510f to your computer and use it in GitHub Desktop.
Full suite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClothingScreenTest { | |
@get:Rule | |
val composeTestRule = createComposeRule() | |
@Test | |
fun whenFavouriteIsTrueThenFilledHeartIconIsDisplayed() { | |
val isFavourite = true | |
composeTestRule.setContent { | |
ClothingAppTDDTheme { | |
FavouriteButton(isFavourite) | |
} | |
} | |
composeTestRule.onNodeWithContentDescription("Filled Heart Icon").assertIsDisplayed() | |
composeTestRule.onNodeWithContentDescription("Empty Heart Icon").assertDoesNotExist() | |
} | |
@Test | |
fun whenFavouriteIsFalseThenEmptyHeartIconIsDisplayed() { | |
val isFavourite = false | |
composeTestRule.setContent { | |
ClothingAppTDDTheme { | |
FavouriteButton(isFavourite) | |
} | |
} | |
composeTestRule.onNodeWithContentDescription("Empty Heart Icon").assertIsDisplayed() | |
composeTestRule.onNodeWithContentDescription("Filled Heart Icon").assertDoesNotExist() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment