Skip to content

Commit

Permalink
Fix waitFor
Browse files Browse the repository at this point in the history
  • Loading branch information
seladb committed Jan 29, 2025
1 parent 235e58d commit 1468a6b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ class ToyVpnViewModelTest {
assertEquals(VpnConnectionState.DISCONNECTED, viewModel.vpnConnectionState.value)

vpnConnectionState.value = VpnConnectionState.CONNECTED
waitFor({ viewModel.vpnConnectionState.value == VpnConnectionState.CONNECTED })
waitFor { viewModel.vpnConnectionState.value == VpnConnectionState.CONNECTED }
}

@Test
fun testVpnConnectionError() = runTest {
assertNull(viewModel.vpnConnectionError.value)

vpnConnectionError.value = "Some error"
waitFor({ viewModel.vpnConnectionError.value == "Some error" })
waitFor { viewModel.vpnConnectionError.value == "Some error" }
}
}

0 comments on commit 1468a6b

Please sign in to comment.