Use string resource for button label (#6897)

This commit is contained in:
Gabriel Brand
2026-05-11 16:09:10 +02:00
committed by GitHub
parent 24a9aea1c9
commit 33fcbad97f
3 changed files with 9 additions and 5 deletions

View File

@@ -156,7 +156,7 @@ private fun TutorialScreenContent(
)
BitwardenFilledButton(
label = state.actionButtonText,
label = stringResource(id = state.actionButtonText),
onClick = { continueClick(state.index) },
modifier = Modifier
.standardHorizontalMargin()

View File

@@ -73,8 +73,12 @@ data class TutorialState(
* - Displays "Continue" if the user is not on the last page.
* - Displays "Get Started" if the user is on the last page.
*/
val actionButtonText: String
get() = if (index != pages.lastIndex) "Continue" else "Get Started"
val actionButtonText: Int
get() = if (index != pages.lastIndex) {
BitwardenString.continue_text
} else {
BitwardenString.get_started
}
/**
* Indicates whether the current slide is the last in the pages array.

View File

@@ -79,7 +79,7 @@ class TutorialScreenTest : AuthenticatorComposeTest() {
it.copy(pages = listOf(TutorialState.TutorialSlide.UniqueCodesSlide))
}
composeTestRule
.onNodeWithText("Get Started")
.onNodeWithText("Get started")
.assertExists()
.assertIsDisplayed()
}
@@ -106,7 +106,7 @@ class TutorialScreenTest : AuthenticatorComposeTest() {
it.copy(pages = listOf(TutorialState.TutorialSlide.UniqueCodesSlide))
}
composeTestRule
.onNodeWithText("Get Started")
.onNodeWithText("Get started")
.performClick()
verify {
viewModel.trySendAction(TutorialAction.ContinueClick(mutableStateFlow.value.index))