Skip to content

Commit

Permalink
Merge branch 'main' into questionnaire-location
Browse files Browse the repository at this point in the history
  • Loading branch information
DebbieArita authored Feb 19, 2024
2 parents 1a8e82c + 7b04c19 commit 94a01e0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ data class LoginConfig(
val pinLoginMessage: String? = null,
val logoHeight: Int = 120,
val logoWidth: Int = 140,
val showAppTitle: Boolean = true,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ fun LoginPage(
.testTag(APP_LOGO_TAG),
)
}
if (applicationConfiguration.appTitle.isNotEmpty()) {
if (
applicationConfiguration.appTitle.isNotEmpty() &&
applicationConfiguration.loginConfig.showAppTitle
) {
Text(
color = if (applicationConfiguration.useDarkTheme) Color.White else LoginDarkColor,
text = applicationConfiguration.appTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ There can only be one instance of application configuration for the entire appli
],
"loginConfig": {
"showLogo": true,
"enablePin": true
"enablePin": true,
"showAppTitle" : true,
"logoHeight" : 120,
"logoWidth" : 140
},
Expand Down Expand Up @@ -69,4 +70,5 @@ loginConfig.showLogo | Display logo in login page | Yes | `true` |
loginConfig.enablePin | Request user for pin after login; to be used for subsequent logins | No | `false` |
loginConfig.logoHeight | Set the maximum height a logo can have | No | 120 |
loginConfig.logoWidth | Set the maximum width a logo can have | No | 140 |
loginConfig.showAppTitle | Toggle App title in LoginScreen visibility | No | true |
deviceToDeviceSync.resourcesToSync | Types of resource to be synced from one device to another during peer connection | No | `false` |

0 comments on commit 94a01e0

Please sign in to comment.