From 7b04c19a1fdeca3cdccdc7e10e015732ac06e55e Mon Sep 17 00:00:00 2001 From: Hamza Ahmed Khan Date: Thu, 15 Feb 2024 11:27:21 +0500 Subject: [PATCH] Add test --- .../integration/ui/login/LoginScreenTest.kt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/login/LoginScreenTest.kt b/android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/login/LoginScreenTest.kt index ed30a8ab96..93f4927368 100644 --- a/android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/login/LoginScreenTest.kt +++ b/android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/login/LoginScreenTest.kt @@ -160,6 +160,29 @@ class LoginScreenTest { ) } + @Test + fun testAppTitleLoginConfigShouldHideAppTitleWhenFalse() { + val appConfigs = + ApplicationConfiguration( + appTitle = "My app", + appId = "app/debug", + loginConfig = LoginConfig(showLogo = true, showAppTitle = false), + ) + composeRule.setContent { + LoginPage( + applicationConfiguration = appConfigs, + username = "user", + onUsernameChanged = { listenerObjectSpy.onUsernameUpdated() }, + password = "password", + onPasswordChanged = { listenerObjectSpy.onPasswordUpdated() }, + forgotPassword = { listenerObjectSpy.forgotPassword() }, + onLoginButtonClicked = { listenerObjectSpy.attemptRemoteLogin() }, + appVersionPair = Pair(1, "1.0.1"), + ) + } + composeRule.onNodeWithTag(APP_NAME_TEXT_TAG).assertDoesNotExist() + } + private fun verifyUnknownTextErrorMessage(loginErrorState: LoginErrorState, errorMessageId: Int) { composeRule.setContent { LoginPage(