diff options
Diffstat (limited to 'src/view/com/util/error')
-rw-r--r-- | src/view/com/util/error/ErrorMessage.tsx | 8 | ||||
-rw-r--r-- | src/view/com/util/error/ErrorScreen.tsx | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/view/com/util/error/ErrorMessage.tsx b/src/view/com/util/error/ErrorMessage.tsx index 905268d3e..ee31ad2cb 100644 --- a/src/view/com/util/error/ErrorMessage.tsx +++ b/src/view/com/util/error/ErrorMessage.tsx @@ -8,7 +8,6 @@ import { } from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {Text} from '../text/Text' -import {colors} from '../../../lib/styles' import {useTheme} from '../../../lib/ThemeContext' import {usePalette} from '../../../lib/hooks/usePalette' @@ -26,7 +25,7 @@ export function ErrorMessage({ const theme = useTheme() const pal = usePalette('error') return ( - <View style={[styles.outer, pal.view, style]}> + <View testID="errorMessageView" style={[styles.outer, pal.view, style]}> <View style={[styles.errorIcon, {backgroundColor: theme.palette.error.icon}]}> <FontAwesomeIcon icon="exclamation" style={pal.text} size={16} /> @@ -38,7 +37,10 @@ export function ErrorMessage({ {message} </Text> {onPressTryAgain && ( - <TouchableOpacity style={styles.btn} onPress={onPressTryAgain}> + <TouchableOpacity + testID="errorMessageTryAgainButton" + style={styles.btn} + onPress={onPressTryAgain}> <FontAwesomeIcon icon="arrows-rotate" style={{color: theme.palette.error.icon}} diff --git a/src/view/com/util/error/ErrorScreen.tsx b/src/view/com/util/error/ErrorScreen.tsx index 6db54a9f2..0033195d9 100644 --- a/src/view/com/util/error/ErrorScreen.tsx +++ b/src/view/com/util/error/ErrorScreen.tsx @@ -11,16 +11,18 @@ export function ErrorScreen({ message, details, onPressTryAgain, + testID, }: { title: string message: string details?: string onPressTryAgain?: () => void + testID?: string }) { const theme = useTheme() const pal = usePalette('error') return ( - <View style={[styles.outer, pal.view]}> + <View testID={testID} style={[styles.outer, pal.view]}> <View style={styles.errorIconContainer}> <View style={[ @@ -40,6 +42,7 @@ export function ErrorScreen({ <Text style={[styles.message, pal.textLight]}>{message}</Text> {details && ( <Text + testID={`${testID}-details`} type="body2" style={[ styles.details, @@ -52,6 +55,7 @@ export function ErrorScreen({ {onPressTryAgain && ( <View style={styles.btnContainer}> <TouchableOpacity + testID="errorScreenTryAgainButton" style={[styles.btn, {backgroundColor: theme.palette.error.icon}]} onPress={onPressTryAgain}> <FontAwesomeIcon icon="arrows-rotate" style={pal.text} size={16} /> |