File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
app/src/androidTest/java/com/pcapplusplus/toyvpn Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,27 @@ class StatsScreenTest {
225225
226226 @Test
227227 fun testVpnDisconnecting () {
228- renderScreen(vpnConnectionState = VpnConnectionState .DISCONNECTING )
228+ val vpnConnectionStateLiveData = MutableLiveData (VpnConnectionState .DISCONNECTING )
229+ every { mockViewModel.vpnConnectionState } returns vpnConnectionStateLiveData
230+ // renderScreen(vpnConnectionState = VpnConnectionState.DISCONNECTING)
231+
232+ composeTestRule.setContent {
233+ ToyVpnPcapPlusPlusTheme {
234+ val navController = rememberNavController()
235+
236+ NavHost (
237+ navController = navController,
238+ startDestination = " stats_screen" ,
239+ ) {
240+ composable(" stats_screen" ) {
241+ StatsScreen (navController, mockViewModel)
242+ }
243+ composable(" connect_screen" ) {
244+ Text (" Connect Screen" )
245+ }
246+ }
247+ }
248+ }
229249
230250 composeTestRule.waitUntil(timeoutMillis = 10000 ) {
231251 try {
You can’t perform that action at this time.
0 commit comments