-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change tests with assertTextEquals
- Loading branch information
1 parent
29b24bb
commit a7decdc
Showing
1 changed file
with
18 additions
and
16 deletions.
There are no files selected for viewing
34 changes: 18 additions & 16 deletions
34
app/src/androidTest/java/com/android/periodpals/ui/profile/ProfileScreenTest.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
package com.android.periodpals.ui.profile | ||
|
||
import androidx.compose.ui.test.assertIsDisplayed | ||
import androidx.compose.ui.test.assertTextEquals | ||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onNodeWithTag | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class ProfileScreenTest { | ||
@get:Rule val composeTestRule = createComposeRule() | ||
@get:Rule | ||
val composeTestRule = createComposeRule() | ||
|
||
@Test | ||
fun displayAllComponents() { | ||
composeTestRule.setContent { ProfileScreen() } | ||
composeTestRule.onNodeWithTag("profileAvatar").assertIsDisplayed() | ||
composeTestRule.onNodeWithTag("profileName").assertIsDisplayed() | ||
composeTestRule.onNodeWithTag("Description").assertIsDisplayed() | ||
composeTestRule.onNodeWithTag("reviewOne").assertIsDisplayed() | ||
composeTestRule.onNodeWithTag("reviewTwo").assertIsDisplayed() | ||
} | ||
@Test | ||
fun displayAllComponents() { | ||
composeTestRule.setContent { ProfileScreen() } | ||
composeTestRule.onNodeWithTag("profileAvatar").assertIsDisplayed() | ||
composeTestRule.onNodeWithTag("profileName").assertIsDisplayed() | ||
composeTestRule.onNodeWithTag("Description").assertIsDisplayed() | ||
composeTestRule.onNodeWithTag("reviewOne").assertIsDisplayed() | ||
composeTestRule.onNodeWithTag("reviewTwo").assertIsDisplayed() | ||
} | ||
|
||
@Test | ||
fun profileScreen_hasCorrectContent() { | ||
composeTestRule.setContent { ProfileScreen() } | ||
composeTestRule.onNodeWithTag("profileName").assertExists("Displayed Name") | ||
composeTestRule.onNodeWithTag("Description").assertExists("Description") | ||
} | ||
@Test | ||
fun profileScreen_hasCorrectContent() { | ||
composeTestRule.setContent { ProfileScreen() } | ||
composeTestRule.onNodeWithTag("profileName").assertTextEquals("Name") | ||
composeTestRule.onNodeWithTag("Description").assertTextEquals("Description") | ||
} | ||
} |