@terreno/ui 0.22.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +27 -0
  2. package/dist/Accordion.js +3 -3
  3. package/dist/Accordion.js.map +1 -1
  4. package/dist/BooleanField.js +6 -4
  5. package/dist/BooleanField.js.map +1 -1
  6. package/dist/Box.js +3 -2
  7. package/dist/Box.js.map +1 -1
  8. package/dist/CheckBox.js +2 -2
  9. package/dist/CheckBox.js.map +1 -1
  10. package/dist/Common.d.ts +40 -57
  11. package/dist/Common.js +1 -0
  12. package/dist/Common.js.map +1 -1
  13. package/dist/CustomSelectField.js +5 -3
  14. package/dist/CustomSelectField.js.map +1 -1
  15. package/dist/DataTable.js +18 -12
  16. package/dist/DataTable.js.map +1 -1
  17. package/dist/DateTimeField.js +5 -3
  18. package/dist/DateTimeField.js.map +1 -1
  19. package/dist/Link.js +2 -2
  20. package/dist/Link.js.map +1 -1
  21. package/dist/MarkdownEditor.js +14 -2
  22. package/dist/MarkdownEditor.js.map +1 -1
  23. package/dist/MarkdownEditorField.js +18 -4
  24. package/dist/MarkdownEditorField.js.map +1 -1
  25. package/dist/Modal.js +10 -6
  26. package/dist/Modal.js.map +1 -1
  27. package/dist/MultiselectField.js +5 -3
  28. package/dist/MultiselectField.js.map +1 -1
  29. package/dist/Page.js +1 -1
  30. package/dist/Page.js.map +1 -1
  31. package/dist/Pagination.js +2 -2
  32. package/dist/Pagination.js.map +1 -1
  33. package/dist/SegmentedControl.js +5 -3
  34. package/dist/SegmentedControl.js.map +1 -1
  35. package/dist/SelectField.js +5 -3
  36. package/dist/SelectField.js.map +1 -1
  37. package/dist/SocialLoginButton.js +2 -1
  38. package/dist/SocialLoginButton.js.map +1 -1
  39. package/dist/Spinner.js +3 -2
  40. package/dist/Spinner.js.map +1 -1
  41. package/dist/TextField.js +6 -4
  42. package/dist/TextField.js.map +1 -1
  43. package/dist/fieldElements/FieldError.d.ts +1 -0
  44. package/dist/fieldElements/FieldError.js +3 -2
  45. package/dist/fieldElements/FieldError.js.map +1 -1
  46. package/dist/fieldElements/FieldHelperText.d.ts +1 -0
  47. package/dist/fieldElements/FieldHelperText.js +3 -2
  48. package/dist/fieldElements/FieldHelperText.js.map +1 -1
  49. package/dist/fieldElements/FieldTitle.d.ts +1 -0
  50. package/dist/fieldElements/FieldTitle.js +4 -3
  51. package/dist/fieldElements/FieldTitle.js.map +1 -1
  52. package/dist/testing/index.d.ts +2 -0
  53. package/dist/testing/index.js +3 -0
  54. package/dist/testing/index.js.map +1 -0
  55. package/dist/testing/resolveTestId.d.ts +39 -0
  56. package/dist/testing/resolveTestId.js +97 -0
  57. package/dist/testing/resolveTestId.js.map +1 -0
  58. package/dist/testing/types.d.ts +59 -0
  59. package/dist/testing/types.js +2 -0
  60. package/dist/testing/types.js.map +1 -0
  61. package/package.json +1 -1
  62. package/src/Accordion.tsx +3 -1
  63. package/src/BooleanField.tsx +13 -3
  64. package/src/Box.tsx +3 -2
  65. package/src/CheckBox.tsx +7 -1
  66. package/src/Common.ts +62 -60
  67. package/src/CustomSelectField.tsx +8 -1
  68. package/src/DataTable.tsx +40 -3
  69. package/src/DateTimeField.tsx +10 -3
  70. package/src/Link.tsx +2 -1
  71. package/src/MarkdownEditor.tsx +52 -27
  72. package/src/MarkdownEditorField.tsx +37 -16
  73. package/src/Modal.tsx +13 -0
  74. package/src/MultiselectField.tsx +8 -3
  75. package/src/Page.tsx +1 -0
  76. package/src/Pagination.tsx +2 -1
  77. package/src/SegmentedControl.tsx +15 -2
  78. package/src/SelectField.tsx +8 -3
  79. package/src/SocialLoginButton.tsx +2 -1
  80. package/src/Spinner.tsx +3 -2
  81. package/src/TextField.tsx +8 -5
  82. package/src/__snapshots__/AddressField.test.tsx.snap +4 -0
  83. package/src/__snapshots__/BooleanField.test.tsx.snap +4 -0
  84. package/src/__snapshots__/Field.test.tsx.snap +8 -0
  85. package/src/__snapshots__/Link.test.tsx.snap +1 -0
  86. package/src/__snapshots__/Page.test.tsx.snap +21 -0
  87. package/src/__snapshots__/SegmentedControl.test.tsx.snap +4 -0
  88. package/src/__snapshots__/UnifiedAddressAutoComplete.test.tsx.snap +1 -0
  89. package/src/fieldElements/FieldError.tsx +7 -2
  90. package/src/fieldElements/FieldHelperText.tsx +4 -2
  91. package/src/fieldElements/FieldTitle.tsx +4 -1
  92. package/src/login/__snapshots__/LoginScreen.test.tsx.snap +4 -0
  93. package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +5 -0
  94. package/src/testing/index.ts +2 -0
  95. package/src/testing/resolveTestId.test.ts +130 -0
  96. package/src/testing/resolveTestId.ts +142 -0
  97. package/src/testing/types.ts +67 -0
@@ -6,6 +6,7 @@ import type {SegmentedControlProps} from "./Common";
6
6
  import {Heading} from "./Heading";
7
7
  import {Icon} from "./Icon";
8
8
  import {useTheme} from "./Theme";
9
+ import {resolveSegmentedControlTestIDsFromProps} from "./testing/resolveTestId";
9
10
 
10
11
  export const SegmentedControl: FC<SegmentedControlProps> = ({
11
12
  items,
@@ -14,9 +15,12 @@ export const SegmentedControl: FC<SegmentedControlProps> = ({
14
15
  selectedIndex,
15
16
  maxItems,
16
17
  badges = [],
18
+ testID,
19
+ testIDs,
17
20
  }) => {
18
21
  const height = size === "md" ? 36 : 44;
19
22
  const {theme} = useTheme();
23
+ const segmentedControlTestIDs = resolveSegmentedControlTestIDsFromProps({testID, testIDs});
20
24
  const [startIndex, setStartIndex] = useState(0);
21
25
 
22
26
  const handlePrevious = useCallback(() => {
@@ -43,9 +47,14 @@ export const SegmentedControl: FC<SegmentedControlProps> = ({
43
47
  flexDirection: "row",
44
48
  gap: 8,
45
49
  }}
50
+ testID={segmentedControlTestIDs.root}
46
51
  >
47
52
  {Boolean(shouldShowScrollButtons) && (
48
- <Pressable disabled={!canScrollLeft} onPress={handlePrevious}>
53
+ <Pressable
54
+ disabled={!canScrollLeft}
55
+ onPress={handlePrevious}
56
+ testID={segmentedControlTestIDs.previousButton}
57
+ >
49
58
  <Icon
50
59
  color={canScrollLeft ? "linkLight" : "extraLight"}
51
60
  iconName="chevron-left"
@@ -113,7 +122,11 @@ export const SegmentedControl: FC<SegmentedControlProps> = ({
113
122
  </View>
114
123
  </View>
115
124
  {Boolean(shouldShowScrollButtons) && (
116
- <Pressable disabled={!canScrollRight} onPress={handleNext}>
125
+ <Pressable
126
+ disabled={!canScrollRight}
127
+ onPress={handleNext}
128
+ testID={segmentedControlTestIDs.nextButton}
129
+ >
117
130
  <Icon
118
131
  color={canScrollRight ? "linkLight" : "extraLight"}
119
132
  iconName="chevron-right"
@@ -4,6 +4,7 @@ import {View} from "react-native";
4
4
  import type {SelectFieldProps} from "./Common";
5
5
  import {FieldError, FieldHelperText, FieldTitle} from "./fieldElements";
6
6
  import {RNPickerSelect} from "./PickerSelect";
7
+ import {resolveFieldTestIDsFromProps} from "./testing/resolveTestId";
7
8
 
8
9
  export const SelectField: FC<SelectFieldProps> = ({
9
10
  disabled = false,
@@ -15,13 +16,16 @@ export const SelectField: FC<SelectFieldProps> = ({
15
16
  title,
16
17
  value,
17
18
  onChange,
19
+ testID,
20
+ testIDs,
18
21
  }) => {
19
22
  const clearOption = {label: placeholder ?? "---", value: ""};
23
+ const fieldTestIDs = resolveFieldTestIDsFromProps({testID, testIDs});
20
24
 
21
25
  return (
22
26
  <View style={{width: "100%"}}>
23
- {Boolean(title) && <FieldTitle text={title!} />}
24
- {Boolean(errorText) && <FieldError text={errorText!} />}
27
+ {Boolean(title) && <FieldTitle testID={fieldTestIDs.label} text={title!} />}
28
+ {Boolean(errorText) && <FieldError testID={fieldTestIDs.error} text={errorText!} />}
25
29
  <RNPickerSelect
26
30
  disabled={disabled}
27
31
  items={options}
@@ -33,9 +37,10 @@ export const SelectField: FC<SelectFieldProps> = ({
33
37
  }
34
38
  }}
35
39
  placeholder={!requireValue ? clearOption : {}}
40
+ textInputProps={{testID: fieldTestIDs.input}}
36
41
  value={value ?? ""}
37
42
  />
38
- {Boolean(helperText) && <FieldHelperText text={helperText!} />}
43
+ {Boolean(helperText) && <FieldHelperText testID={fieldTestIDs.helper} text={helperText!} />}
39
44
  </View>
40
45
  );
41
46
  };
@@ -75,6 +75,7 @@ export const SocialLoginButton: FC<SocialLoginButtonProps> = ({
75
75
  }) => {
76
76
  const [loading, setLoading] = useState(propsLoading);
77
77
  const {theme} = useTheme();
78
+ const resolvedTestID = testID ?? `social-login-${provider}`;
78
79
 
79
80
  const {backgroundColor, borderColor, textColor} = useMemo(() => {
80
81
  const colors = PROVIDER_COLORS[provider];
@@ -146,7 +147,7 @@ export const SocialLoginButton: FC<SocialLoginButtonProps> = ({
146
147
  paddingVertical: 12,
147
148
  width: fullWidth ? "100%" : "auto",
148
149
  }}
149
- testID={testID ?? `social-login-${provider}`}
150
+ testID={resolvedTestID}
150
151
  >
151
152
  <View style={{alignItems: "center", flexDirection: "row"}}>
152
153
  {Boolean(iconName) && (
package/src/Spinner.tsx CHANGED
@@ -3,8 +3,9 @@ import {ActivityIndicator} from "react-native";
3
3
 
4
4
  import type {SpinnerProps} from "./Common";
5
5
  import {useTheme} from "./Theme";
6
+ import {toTestProps} from "./testing/resolveTestId";
6
7
 
7
- export const Spinner: FC<SpinnerProps> = ({size = "md", color = "light"}) => {
8
+ export const Spinner: FC<SpinnerProps> = ({size = "md", color = "light", testID}) => {
8
9
  const [show, setShow] = useState(false);
9
10
  const {theme} = useTheme();
10
11
 
@@ -31,5 +32,5 @@ export const Spinner: FC<SpinnerProps> = ({size = "md", color = "light"}) => {
31
32
  }
32
33
 
33
34
  const spinnerSize: "small" | "large" = size === "sm" ? "small" : "large";
34
- return <ActivityIndicator color={computedColor} size={spinnerSize} />;
35
+ return <ActivityIndicator color={computedColor} size={spinnerSize} {...toTestProps(testID)} />;
35
36
  };
package/src/TextField.tsx CHANGED
@@ -15,6 +15,7 @@ import type {TextFieldProps, TextStyleWithOutline} from "./Common";
15
15
  import {FieldError, FieldHelperText, FieldTitle} from "./fieldElements";
16
16
  import {Icon} from "./Icon";
17
17
  import {useTheme} from "./Theme";
18
+ import {resolveFieldTestIDsFromProps} from "./testing/resolveTestId";
18
19
 
19
20
  const keyboardMap: {[id: string]: string | undefined} = {
20
21
  date: "default",
@@ -79,10 +80,12 @@ export const TextField: FC<TextFieldProps> = ({
79
80
  onEnter,
80
81
  onSubmitEditing,
81
82
  testID,
83
+ testIDs,
82
84
  id,
83
85
  aiSuggestion,
84
86
  }) => {
85
87
  const {theme} = useTheme();
88
+ const fieldTestIDs = resolveFieldTestIDsFromProps({testID, testIDs});
86
89
 
87
90
  const calendar = getCalendars()[0];
88
91
  const localTimeZone = calendar?.timeZone;
@@ -147,8 +150,8 @@ export const TextField: FC<TextFieldProps> = ({
147
150
  width: "100%",
148
151
  }}
149
152
  >
150
- {Boolean(title) && <FieldTitle text={title!} />}
151
- {Boolean(errorText) && <FieldError text={errorText!} />}
153
+ {Boolean(title) && <FieldTitle testID={fieldTestIDs.label} text={title!} />}
154
+ {Boolean(errorText) && <FieldError testID={fieldTestIDs.error} text={errorText!} />}
152
155
  <View
153
156
  style={{
154
157
  backgroundColor: disabled ? theme.surface.neutralLight : theme.surface.base,
@@ -164,7 +167,7 @@ export const TextField: FC<TextFieldProps> = ({
164
167
  >
165
168
  {Boolean(aiSuggestion) && (
166
169
  <AiSuggestionBox
167
- testID={testID ? `${testID}-ai-suggestion` : undefined}
170
+ testID={fieldTestIDs.input ? `${fieldTestIDs.input}-ai-suggestion` : undefined}
168
171
  {...aiSuggestion!}
169
172
  />
170
173
  )}
@@ -236,7 +239,7 @@ export const TextField: FC<TextFieldProps> = ({
236
239
  }}
237
240
  secureTextEntry={type === "password"}
238
241
  style={defaultTextInputStyles}
239
- testID={testID}
242
+ testID={fieldTestIDs.input}
240
243
  textContentType={textContentType}
241
244
  underlineColorAndroid="transparent"
242
245
  value={value}
@@ -248,7 +251,7 @@ export const TextField: FC<TextFieldProps> = ({
248
251
  )}
249
252
  </View>
250
253
  </View>
251
- {Boolean(helperText) && <FieldHelperText text={helperText!} />}
254
+ {Boolean(helperText) && <FieldHelperText testID={fieldTestIDs.helper} text={helperText!} />}
252
255
  {/* {type === "numberRange" && value && (
253
256
  <NumberPickerActionSheet
254
257
  actionSheetRef={numberRangeActionSheetRef}
@@ -20,6 +20,7 @@ exports[`AddressField renders correctly with default props 1`] = `
20
20
  "fontWeight": 600,
21
21
  "lineHeight": 22.4,
22
22
  },
23
+ "testID": "test-address-address1.label",
23
24
  },
24
25
  "type": "Text",
25
26
  },
@@ -137,6 +138,7 @@ exports[`AddressField renders correctly with default props 1`] = `
137
138
  "fontWeight": 600,
138
139
  "lineHeight": 22.4,
139
140
  },
141
+ "testID": "test-address-address2.label",
140
142
  },
141
143
  "type": "Text",
142
144
  },
@@ -254,6 +256,7 @@ exports[`AddressField renders correctly with default props 1`] = `
254
256
  "fontWeight": 600,
255
257
  "lineHeight": 22.4,
256
258
  },
259
+ "testID": "test-address-city.label",
257
260
  },
258
261
  "type": "Text",
259
262
  },
@@ -1155,6 +1158,7 @@ exports[`AddressField renders correctly with default props 1`] = `
1155
1158
  "fontWeight": 600,
1156
1159
  "lineHeight": 22.4,
1157
1160
  },
1161
+ "testID": "test-address-zip.label",
1158
1162
  },
1159
1163
  "type": "Text",
1160
1164
  },
@@ -103,6 +103,7 @@ exports[`BooleanField renders correctly with default props 1`] = `
103
103
  "flexDirection": "row",
104
104
  "justifyContent": "center",
105
105
  },
106
+ "testID": undefined,
106
107
  },
107
108
  "type": "Pressable",
108
109
  },
@@ -247,6 +248,7 @@ exports[`BooleanField renders with title 1`] = `
247
248
  "flexDirection": "row",
248
249
  "justifyContent": "center",
249
250
  },
251
+ "testID": undefined,
250
252
  },
251
253
  "type": "Pressable",
252
254
  },
@@ -376,6 +378,7 @@ exports[`BooleanField renders with value true 1`] = `
376
378
  "flexDirection": "row",
377
379
  "justifyContent": "center",
378
380
  },
381
+ "testID": undefined,
379
382
  },
380
383
  "type": "Pressable",
381
384
  },
@@ -490,6 +493,7 @@ exports[`BooleanField renders disabled state 1`] = `
490
493
  "flexDirection": "row",
491
494
  "justifyContent": "center",
492
495
  },
496
+ "testID": undefined,
493
497
  },
494
498
  "type": "Pressable",
495
499
  },
@@ -754,6 +754,7 @@ exports[`Field renders boolean field 1`] = `
754
754
  "flexDirection": "row",
755
755
  "justifyContent": "center",
756
756
  },
757
+ "testID": undefined,
757
758
  },
758
759
  "type": "Pressable",
759
760
  },
@@ -1026,6 +1027,7 @@ exports[`Field renders date field 1`] = `
1026
1027
  "minWidth": 200,
1027
1028
  "paddingHorizontal": 6,
1028
1029
  },
1030
+ "testID": undefined,
1029
1031
  },
1030
1032
  "type": "Pressable",
1031
1033
  }
@@ -1806,6 +1808,7 @@ exports[`Field renders time field 1`] = `
1806
1808
  "minWidth": 230,
1807
1809
  "paddingHorizontal": 6,
1808
1810
  },
1811
+ "testID": undefined,
1809
1812
  },
1810
1813
  "type": "Pressable",
1811
1814
  }
@@ -2824,6 +2827,7 @@ exports[`Field renders datetime field 1`] = `
2824
2827
  "minWidth": 230,
2825
2828
  "paddingHorizontal": 6,
2826
2829
  },
2830
+ "testID": undefined,
2827
2831
  },
2828
2832
  "type": "Pressable",
2829
2833
  }
@@ -3361,6 +3365,7 @@ exports[`Field renders address field 1`] = `
3361
3365
  "fontWeight": 600,
3362
3366
  "lineHeight": 22.4,
3363
3367
  },
3368
+ "testID": "undefined-address1.label",
3364
3369
  },
3365
3370
  "type": "Text",
3366
3371
  },
@@ -3478,6 +3483,7 @@ exports[`Field renders address field 1`] = `
3478
3483
  "fontWeight": 600,
3479
3484
  "lineHeight": 22.4,
3480
3485
  },
3486
+ "testID": "undefined-address2.label",
3481
3487
  },
3482
3488
  "type": "Text",
3483
3489
  },
@@ -3595,6 +3601,7 @@ exports[`Field renders address field 1`] = `
3595
3601
  "fontWeight": 600,
3596
3602
  "lineHeight": 22.4,
3597
3603
  },
3604
+ "testID": "undefined-city.label",
3598
3605
  },
3599
3606
  "type": "Text",
3600
3607
  },
@@ -4496,6 +4503,7 @@ exports[`Field renders address field 1`] = `
4496
4503
  "fontWeight": 600,
4497
4504
  "lineHeight": 22.4,
4498
4505
  },
4506
+ "testID": "undefined-zip.label",
4499
4507
  },
4500
4508
  "type": "Text",
4501
4509
  },
@@ -28,6 +28,7 @@ exports[`Link renders correctly with href 1`] = `
28
28
  "aria-role": "button",
29
29
  "hitSlop": 20,
30
30
  "onPress": [Function],
31
+ "testID": undefined,
31
32
  },
32
33
  "type": "Pressable",
33
34
  }
@@ -56,6 +56,7 @@ exports[`Page renders correctly with default props 1`] = `
56
56
  "maxWidth": 800,
57
57
  "padding": 8,
58
58
  "scroll": true,
59
+ "testID": undefined,
59
60
  "width": "100%",
60
61
  },
61
62
  "testID": undefined,
@@ -91,6 +92,7 @@ exports[`Page renders correctly with default props 1`] = `
91
92
  "maxWidth": 800,
92
93
  "padding": 8,
93
94
  "scroll": true,
95
+ "testID": undefined,
94
96
  "width": "100%",
95
97
  },
96
98
  },
@@ -227,6 +229,7 @@ exports[`Page renders with title 1`] = `
227
229
  "maxWidth": 800,
228
230
  "padding": 8,
229
231
  "scroll": true,
232
+ "testID": undefined,
230
233
  "width": "100%",
231
234
  },
232
235
  "testID": undefined,
@@ -262,6 +265,7 @@ exports[`Page renders with title 1`] = `
262
265
  "maxWidth": 800,
263
266
  "padding": 8,
264
267
  "scroll": true,
268
+ "testID": undefined,
265
269
  "width": "100%",
266
270
  },
267
271
  },
@@ -439,6 +443,7 @@ exports[`Page renders with back button 1`] = `
439
443
  "maxWidth": 800,
440
444
  "padding": 8,
441
445
  "scroll": true,
446
+ "testID": undefined,
442
447
  "width": "100%",
443
448
  },
444
449
  "testID": undefined,
@@ -474,6 +479,7 @@ exports[`Page renders with back button 1`] = `
474
479
  "maxWidth": 800,
475
480
  "padding": 8,
476
481
  "scroll": true,
482
+ "testID": undefined,
477
483
  "width": "100%",
478
484
  },
479
485
  },
@@ -651,6 +657,7 @@ exports[`Page renders with close button 1`] = `
651
657
  "maxWidth": 800,
652
658
  "padding": 8,
653
659
  "scroll": true,
660
+ "testID": undefined,
654
661
  "width": "100%",
655
662
  },
656
663
  "testID": undefined,
@@ -686,6 +693,7 @@ exports[`Page renders with close button 1`] = `
686
693
  "maxWidth": 800,
687
694
  "padding": 8,
688
695
  "scroll": true,
696
+ "testID": undefined,
689
697
  "width": "100%",
690
698
  },
691
699
  },
@@ -909,6 +917,7 @@ exports[`Page renders with right button 1`] = `
909
917
  "maxWidth": 800,
910
918
  "padding": 8,
911
919
  "scroll": true,
920
+ "testID": undefined,
912
921
  "width": "100%",
913
922
  },
914
923
  "testID": undefined,
@@ -944,6 +953,7 @@ exports[`Page renders with right button 1`] = `
944
953
  "maxWidth": 800,
945
954
  "padding": 8,
946
955
  "scroll": true,
956
+ "testID": undefined,
947
957
  "width": "100%",
948
958
  },
949
959
  },
@@ -1022,6 +1032,7 @@ exports[`Page renders loading state 1`] = `
1022
1032
  "maxWidth": 800,
1023
1033
  "padding": 8,
1024
1034
  "scroll": true,
1035
+ "testID": undefined,
1025
1036
  "width": "100%",
1026
1037
  },
1027
1038
  "testID": undefined,
@@ -1057,6 +1068,7 @@ exports[`Page renders loading state 1`] = `
1057
1068
  "maxWidth": 800,
1058
1069
  "padding": 8,
1059
1070
  "scroll": true,
1071
+ "testID": undefined,
1060
1072
  "width": "100%",
1061
1073
  },
1062
1074
  },
@@ -1141,6 +1153,7 @@ exports[`Page renders with footer 1`] = `
1141
1153
  "maxWidth": 800,
1142
1154
  "padding": 8,
1143
1155
  "scroll": true,
1156
+ "testID": undefined,
1144
1157
  "width": "100%",
1145
1158
  },
1146
1159
  "testID": undefined,
@@ -1176,6 +1189,7 @@ exports[`Page renders with footer 1`] = `
1176
1189
  "maxWidth": 800,
1177
1190
  "padding": 8,
1178
1191
  "scroll": true,
1192
+ "testID": undefined,
1179
1193
  "width": "100%",
1180
1194
  },
1181
1195
  },
@@ -1311,6 +1325,7 @@ exports[`Page renders with custom padding 1`] = `
1311
1325
  "maxWidth": 800,
1312
1326
  "padding": 24,
1313
1327
  "scroll": true,
1328
+ "testID": undefined,
1314
1329
  "width": "100%",
1315
1330
  },
1316
1331
  "testID": undefined,
@@ -1346,6 +1361,7 @@ exports[`Page renders with custom padding 1`] = `
1346
1361
  "maxWidth": 800,
1347
1362
  "padding": 24,
1348
1363
  "scroll": true,
1364
+ "testID": undefined,
1349
1365
  "width": "100%",
1350
1366
  },
1351
1367
  },
@@ -1429,6 +1445,7 @@ exports[`Page renders with custom color 1`] = `
1429
1445
  "maxWidth": 800,
1430
1446
  "padding": 8,
1431
1447
  "scroll": true,
1448
+ "testID": undefined,
1432
1449
  "width": "100%",
1433
1450
  },
1434
1451
  "testID": undefined,
@@ -1464,6 +1481,7 @@ exports[`Page renders with custom color 1`] = `
1464
1481
  "maxWidth": 800,
1465
1482
  "padding": 8,
1466
1483
  "scroll": true,
1484
+ "testID": undefined,
1467
1485
  "width": "100%",
1468
1486
  },
1469
1487
  },
@@ -1544,6 +1562,7 @@ exports[`Page renders with scroll disabled 1`] = `
1544
1562
  "maxWidth": 800,
1545
1563
  "padding": 8,
1546
1564
  "scroll": false,
1565
+ "testID": undefined,
1547
1566
  "width": "100%",
1548
1567
  },
1549
1568
  "testID": undefined,
@@ -1628,6 +1647,7 @@ exports[`Page renders with custom maxWidth 1`] = `
1628
1647
  "maxWidth": 600,
1629
1648
  "padding": 8,
1630
1649
  "scroll": true,
1650
+ "testID": undefined,
1631
1651
  "width": "100%",
1632
1652
  },
1633
1653
  "testID": undefined,
@@ -1663,6 +1683,7 @@ exports[`Page renders with custom maxWidth 1`] = `
1663
1683
  "maxWidth": 600,
1664
1684
  "padding": 8,
1665
1685
  "scroll": true,
1686
+ "testID": undefined,
1666
1687
  "width": "100%",
1667
1688
  },
1668
1689
  },
@@ -1049,6 +1049,7 @@ exports[`SegmentedControl renders with maxItems and scroll buttons 1`] = `
1049
1049
  "props": {
1050
1050
  "disabled": true,
1051
1051
  "onPress": [Function],
1052
+ "testID": undefined,
1052
1053
  },
1053
1054
  "type": "Pressable",
1054
1055
  },
@@ -1216,6 +1217,7 @@ exports[`SegmentedControl renders with maxItems and scroll buttons 1`] = `
1216
1217
  "props": {
1217
1218
  "disabled": false,
1218
1219
  "onPress": [Function],
1220
+ "testID": undefined,
1219
1221
  },
1220
1222
  "type": "Pressable",
1221
1223
  },
@@ -1243,6 +1245,7 @@ exports[`SegmentedControl handles scroll navigation 1`] = `
1243
1245
  "props": {
1244
1246
  "disabled": true,
1245
1247
  "onPress": [Function],
1248
+ "testID": undefined,
1246
1249
  },
1247
1250
  "type": "Pressable",
1248
1251
  },
@@ -1410,6 +1413,7 @@ exports[`SegmentedControl handles scroll navigation 1`] = `
1410
1413
  "props": {
1411
1414
  "disabled": false,
1412
1415
  "onPress": [Function],
1416
+ "testID": undefined,
1413
1417
  },
1414
1418
  "type": "Pressable",
1415
1419
  },
@@ -556,6 +556,7 @@ exports[`UnifiedAddressAutoCompleteField renders with testID 1`] = `
556
556
  "fontWeight": 600,
557
557
  "lineHeight": 22.4,
558
558
  },
559
+ "testID": "address-field.label",
559
560
  },
560
561
  "type": "Text",
561
562
  },
@@ -5,16 +5,21 @@ import {Text, View} from "react-native";
5
5
 
6
6
  import {Icon} from "../Icon";
7
7
  import {useTheme} from "../Theme";
8
+ import {toTestProps} from "../testing/resolveTestId";
8
9
 
9
10
  interface FieldErrorProps {
10
11
  text: string;
12
+ testID?: string;
11
13
  }
12
14
 
13
- export const FieldError: FC<FieldErrorProps> = ({text}) => {
15
+ export const FieldError: FC<FieldErrorProps> = ({text, testID}) => {
14
16
  const {theme} = useTheme();
15
17
 
16
18
  return (
17
- <View style={{alignItems: "center", flexDirection: "row", marginVertical: 2}}>
19
+ <View
20
+ style={{alignItems: "center", flexDirection: "row", marginVertical: 2}}
21
+ {...toTestProps(testID)}
22
+ >
18
23
  <Icon color="error" iconName="triangle-exclamation" size="sm" />
19
24
  <View style={{marginLeft: 4}}>
20
25
  <Text style={{color: theme.text.error, fontSize: 12}}>{text}</Text>
@@ -4,16 +4,18 @@ import type {FC} from "react";
4
4
  import {Text, View} from "react-native";
5
5
 
6
6
  import {useTheme} from "../Theme";
7
+ import {toTestProps} from "../testing/resolveTestId";
7
8
 
8
9
  interface FieldHelperTextProps {
9
10
  text: string;
11
+ testID?: string;
10
12
  }
11
13
 
12
- export const FieldHelperText: FC<FieldHelperTextProps> = ({text}) => {
14
+ export const FieldHelperText: FC<FieldHelperTextProps> = ({text, testID}) => {
13
15
  const {theme} = useTheme();
14
16
 
15
17
  return (
16
- <View style={{marginTop: 2}}>
18
+ <View style={{marginTop: 2}} {...toTestProps(testID)}>
17
19
  <Text style={{color: theme.text.primary, fontSize: 12, lineHeight: 16}}>{text}</Text>
18
20
  </View>
19
21
  );
@@ -6,13 +6,15 @@ import {Text} from "react-native";
6
6
 
7
7
  import {isMobileDevice} from "../MediaQuery";
8
8
  import {useTheme} from "../Theme";
9
+ import {toTestProps} from "../testing/resolveTestId";
9
10
  import {isNative} from "../Utilities";
10
11
 
11
12
  interface FieldTitleProps {
12
13
  text: string;
14
+ testID?: string;
13
15
  }
14
16
 
15
- export const FieldTitle: FC<FieldTitleProps> = ({text}) => {
17
+ export const FieldTitle: FC<FieldTitleProps> = ({text, testID}) => {
16
18
  const {theme} = useTheme();
17
19
  const isMobileOrNative = isMobileDevice() || isNative();
18
20
 
@@ -24,6 +26,7 @@ export const FieldTitle: FC<FieldTitleProps> = ({text}) => {
24
26
  fontWeight: 600,
25
27
  lineHeight: 22.4,
26
28
  }}
29
+ {...toTestProps(testID)}
27
30
  >
28
31
  {text}
29
32
  </Text>
@@ -64,6 +64,7 @@ exports[`LoginScreen renders correctly with all props 1`] = `
64
64
  "fontWeight": 600,
65
65
  "lineHeight": 22.4,
66
66
  },
67
+ "testID": "login-screen-email-input.label",
67
68
  },
68
69
  "type": "Text",
69
70
  },
@@ -169,6 +170,7 @@ exports[`LoginScreen renders correctly with all props 1`] = `
169
170
  "fontWeight": 600,
170
171
  "lineHeight": 22.4,
171
172
  },
173
+ "testID": "login-screen-password-input.label",
172
174
  },
173
175
  "type": "Text",
174
176
  },
@@ -604,6 +606,7 @@ exports[`LoginScreen renders correctly with all props 1`] = `
604
606
  "maxWidth": 800,
605
607
  "padding": 8,
606
608
  "scroll": true,
609
+ "testID": undefined,
607
610
  "width": "100%",
608
611
  },
609
612
  "testID": undefined,
@@ -639,6 +642,7 @@ exports[`LoginScreen renders correctly with all props 1`] = `
639
642
  "maxWidth": 800,
640
643
  "padding": 8,
641
644
  "scroll": true,
645
+ "testID": undefined,
642
646
  "width": "100%",
643
647
  },
644
648
  },
@@ -64,6 +64,7 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
64
64
  "fontWeight": 600,
65
65
  "lineHeight": 22.4,
66
66
  },
67
+ "testID": "signup-screen-name-input.label",
67
68
  },
68
69
  "type": "Text",
69
70
  },
@@ -169,6 +170,7 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
169
170
  "fontWeight": 600,
170
171
  "lineHeight": 22.4,
171
172
  },
173
+ "testID": "signup-screen-email-input.label",
172
174
  },
173
175
  "type": "Text",
174
176
  },
@@ -274,6 +276,7 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
274
276
  "fontWeight": 600,
275
277
  "lineHeight": 22.4,
276
278
  },
279
+ "testID": "signup-screen-password-input.label",
277
280
  },
278
281
  "type": "Text",
279
282
  },
@@ -860,6 +863,7 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
860
863
  "maxWidth": 800,
861
864
  "padding": 8,
862
865
  "scroll": true,
866
+ "testID": undefined,
863
867
  "width": "100%",
864
868
  },
865
869
  "testID": undefined,
@@ -895,6 +899,7 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
895
899
  "maxWidth": 800,
896
900
  "padding": 8,
897
901
  "scroll": true,
902
+ "testID": undefined,
898
903
  "width": "100%",
899
904
  },
900
905
  },
@@ -0,0 +1,2 @@
1
+ export * from "./resolveTestId";
2
+ export * from "./types";