Skip to content

Commit

Permalink
#9 - Debugging tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jhg3410 committed Feb 24, 2023
1 parent b46cdee commit 398f639
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.example.compose.rally

import androidx.compose.ui.test.assertIsSelected
import androidx.compose.ui.test.*
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.text.toUpperCase
import com.example.compose.rally.ui.components.RallyTopAppBar
import org.junit.Rule
import org.junit.Test
Expand All @@ -27,4 +27,21 @@ class TopAppBarTest {
.onNodeWithContentDescription(RallyScreen.Accounts.name)
.assertIsSelected()
}

@Test
fun rallyTopAppBarTest_currentLabelExists() {
val allScreens = RallyScreen.values().toList()
composeTestRule.setContent {
RallyTopAppBar(
allScreens = allScreens,
onTabSelected = {},
currentScreen = RallyScreen.Accounts
)
}
composeTestRule.onRoot().printToLog("currentLabelExists")

composeTestRule
.onNodeWithContentDescription(RallyScreen.Accounts.name)
.assertExists()
}
}

0 comments on commit 398f639

Please sign in to comment.