mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-19 21:58:29 +01:00
fix(suite-native): welcome flow test ids
This commit is contained in:
@@ -17,6 +17,7 @@ type SwitchProps = {
|
||||
isChecked: boolean;
|
||||
onChange: (value: boolean) => void;
|
||||
isDisabled?: boolean; // Functionality of disabled works but styles are not implemented yet (waiting for design)
|
||||
testID?: string;
|
||||
};
|
||||
|
||||
const SWITCH_CONTAINER_BORDER_WIDTH = 1;
|
||||
@@ -89,7 +90,7 @@ const useAnimationStyles = ({ isChecked }: Pick<SwitchProps, 'isChecked'>) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const Switch = ({ isChecked, onChange, isDisabled = false }: SwitchProps) => {
|
||||
export const Switch = ({ isChecked, onChange, isDisabled = false, testID }: SwitchProps) => {
|
||||
const { applyStyle } = useNativeStyles();
|
||||
|
||||
const { animatedSwitchCircleStyle, animatedSwitchContainerStyle } = useAnimationStyles({
|
||||
@@ -102,7 +103,7 @@ export const Switch = ({ isChecked, onChange, isDisabled = false }: SwitchProps)
|
||||
};
|
||||
|
||||
return (
|
||||
<Pressable onPress={handlePress} accessibilityRole="switch">
|
||||
<Pressable onPress={handlePress} accessibilityRole="switch" testID={testID}>
|
||||
<Animated.View
|
||||
style={[
|
||||
animatedSwitchContainerStyle,
|
||||
|
||||
@@ -98,6 +98,7 @@ export const AnalyticsConsentScreen = () => {
|
||||
<Translation id="moduleOnboarding.analyticsConsentScreen.helpSwitchTitle" />
|
||||
</Text>
|
||||
<Switch
|
||||
testID="@onboarding/AnalyticsConsent/consentSwitch"
|
||||
isChecked={isEnabled}
|
||||
onChange={enabled => {
|
||||
setIsEnabled(enabled);
|
||||
@@ -110,14 +111,14 @@ export const AnalyticsConsentScreen = () => {
|
||||
</VStack>
|
||||
<VStack spacing="sp12">
|
||||
<Button
|
||||
testID="@onboarding/UserDataConsent/allow"
|
||||
testID="@onboarding/AnalyticsConsent/nextBtn"
|
||||
onPress={isEnabled ? handleAnalyticsConsent : handleRedirect}
|
||||
>
|
||||
<Translation id="generic.buttons.confirm" />
|
||||
</Button>
|
||||
<Button
|
||||
colorScheme="tertiaryElevation0"
|
||||
testID="@onboarding/UserDataConsent/allow"
|
||||
testID="@onboarding/AnalyticsConsent/learMoreBtn"
|
||||
onPress={handleClickOnLearMoreLink}
|
||||
>
|
||||
<Translation id="moduleOnboarding.analyticsConsentScreen.learnMoreButton" />
|
||||
|
||||
@@ -77,7 +77,10 @@ export const WelcomeScreen = ({
|
||||
</Box>
|
||||
</VStack>
|
||||
<Box style={applyStyle(buttonWrapperStyle)}>
|
||||
<Button onPress={navigateToAnalyticsConsent}>
|
||||
<Button
|
||||
onPress={navigateToAnalyticsConsent}
|
||||
testID="@onboarding/Welcome/nextBtn"
|
||||
>
|
||||
<Translation id="moduleOnboarding.welcomeScreen.button" />
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user