From c4b2bfd4b8b82d9b4bf154dfaf339105fa7c6a98 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Fri, 25 Aug 2023 12:45:36 +0200 Subject: [PATCH] Add ui tests for out of time behaviour --- .../compose/screen/ConnectScreenTest.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt index 67e53da74750..40f9b278b82a 100644 --- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt +++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt @@ -820,4 +820,20 @@ class ConnectScreenTest { // Assert composeTestRule.apply { onNodeWithTag(SCROLLABLE_COLUMN_TEST_TAG).assertDoesNotExist() } } + + @Test + fun testOpenOutOfTimeScreen() { + // Arrange + val mockedOpenScreenHandler: () -> Unit = mockk(relaxed = true) + composeTestRule.setContent { + ConnectScreen( + uiState = ConnectUiState.INITIAL, + viewActions = MutableStateFlow(ConnectViewModel.ViewAction.OpenOutOfTimeView), + onOpenOutOfTimeScreen = mockedOpenScreenHandler + ) + } + + // Assert + verify { mockedOpenScreenHandler.invoke() } + } }