File tree 1 file changed +24
-3
lines changed
src/design-system/text-box
1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -64,14 +64,35 @@ export const TextBox = ({
64
64
onChange = { onChange }
65
65
id = { id }
66
66
maxLength = { maxLength }
67
- data-testid = { rest [ 'data-testid' ] }
67
+ data-testid = {
68
+ rest [ 'data-testid' ]
69
+ ? `${ rest [ 'data-testid' ] } -input`
70
+ : 'text-box-input'
71
+ }
68
72
/>
69
73
</ Form . Control >
70
- < Form . Label className = { cn ( cx . label ) } > { label } </ Form . Label >
74
+ < Form . Label
75
+ className = { cn ( cx . label ) }
76
+ data-testid = {
77
+ rest [ 'data-testid' ]
78
+ ? `${ rest [ 'data-testid' ] } -label`
79
+ : 'text-box-label'
80
+ }
81
+ >
82
+ { label }
83
+ </ Form . Label >
71
84
</ Form . Field >
72
85
</ Flex >
73
86
{ errorMessage && (
74
- < Text . Label color = "error" className = { cx . errorMessage } >
87
+ < Text . Label
88
+ color = "error"
89
+ className = { cx . errorMessage }
90
+ data-testid = {
91
+ rest [ 'data-testid' ]
92
+ ? `${ rest [ 'data-testid' ] } -error`
93
+ : 'text-box-error'
94
+ }
95
+ >
75
96
{ errorMessage }
76
97
</ Text . Label >
77
98
) }
You can’t perform that action at this time.
0 commit comments