QA-953: Adding testTag to elements in Add TOTP screen (#4160)

This commit is contained in:
ifernandezdiaz 2024-10-28 11:28:07 -03:00 committed by GitHub
parent 3e2f10a5b9
commit c47f8606cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -23,6 +23,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
@ -126,7 +127,9 @@ fun ManualCodeEntryScreen(
Text(
text = stringResource(id = R.string.enter_key_manually),
style = BitwardenTheme.typography.titleMedium,
modifier = Modifier.padding(horizontal = 16.dp),
modifier = Modifier
.padding(horizontal = 16.dp)
.testTag("EnterKeyManuallyButton"),
)
Spacer(modifier = Modifier.height(8.dp))
@ -143,7 +146,8 @@ fun ManualCodeEntryScreen(
},
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
.padding(horizontal = 16.dp)
.testTag("AddManualTOTPField"),
)
Spacer(modifier = Modifier.height(16.dp))
@ -154,7 +158,8 @@ fun ManualCodeEntryScreen(
},
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
.padding(horizontal = 16.dp)
.testTag("AddManualTOTPButton"),
)
Text(
@ -191,6 +196,7 @@ fun ManualCodeEntryScreen(
}
},
style = BitwardenTheme.typography.bodyMedium,
modifier = Modifier.testTag("ScanQRCodeButton"),
)
}
}

View file

@ -44,6 +44,7 @@ import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.nativeCanvas
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
@ -426,6 +427,7 @@ private fun BottomClickableText(
style = BitwardenTheme.typography.labelLarge,
innerPadding = PaddingValues(vertical = 4.dp, horizontal = 12.dp),
onClick = onEnterCodeManuallyClick,
modifier = Modifier.testTag("EnterKeyManuallyButton"),
)
}
}