From 242c15264943d0e75faec074380678a68d071074 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Wed, 29 May 2024 15:22:46 +0200 Subject: [PATCH] Renamed lingering references to tunnel ui state --- .../mullvadvpn/viewmodel/ConnectViewModelTest.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt index 10f83cbf5ad4..2de7724c6946 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt @@ -155,11 +155,11 @@ class ConnectViewModelTest { } @Test - fun `given change in tunnelUiState uiState should emit new tunnelUiState`() = runTest { + fun `given change in tunnelState uiState should emit new tunnelState`() = runTest { // Arrange val tunnelEndpoint: TunnelEndpoint = mockk() val location: GeoIpLocation = mockk() - val tunnelUiStateTestItem = TunnelState.Connected(tunnelEndpoint, location) + val tunnelStateTestItem = TunnelState.Connected(tunnelEndpoint, location) every { tunnelEndpoint.toInAddress() } returns mockk(relaxed = true) every { location.toOutAddress() } returns "1.1.1.1" every { location.hostname } returns "hostname" @@ -167,9 +167,9 @@ class ConnectViewModelTest { // Act, Assert viewModel.uiState.test { assertEquals(ConnectUiState.INITIAL, awaitItem()) - tunnelState.emit(tunnelUiStateTestItem) + tunnelState.emit(tunnelStateTestItem) val result = awaitItem() - assertEquals(tunnelUiStateTestItem, result.tunnelState) + assertEquals(tunnelStateTestItem, result.tunnelState) } } @@ -283,13 +283,13 @@ class ConnectViewModelTest { val mockErrorState: ErrorState = mockk() val expectedConnectNotificationState = InAppNotification.TunnelStateError(mockErrorState) - val tunnelUiState = TunnelState.Error(mockErrorState) + val tunnelStateError = TunnelState.Error(mockErrorState) notifications.value = listOf(expectedConnectNotificationState) // Act, Assert viewModel.uiState.test { assertEquals(ConnectUiState.INITIAL, awaitItem()) - tunnelState.emit(tunnelUiState) + tunnelState.emit(tunnelStateError) val result = awaitItem() assertEquals(expectedConnectNotificationState, result.inAppNotification) }