File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
protocol-designer/src/molecules/TextAreaField Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -54,4 +54,16 @@ describe('TextAreaField', () => {
54
54
55
55
expect ( screen . getByText ( 'Error: Invalid input' ) ) . toBeInTheDocument ( )
56
56
} )
57
+
58
+ it ( 'display an icon when tooltip prop is provided' , ( ) => {
59
+ props . tooltipText = 'ot-icon-check'
60
+ render ( props )
61
+ screen . getByTestId ( 'tooltip-icon' )
62
+ } )
63
+
64
+ it ( 'display left icon when leftIcon prop is provided' , ( ) => {
65
+ props . leftIcon = 'information'
66
+ render ( props )
67
+ screen . getByTestId ( 'left-icon' )
68
+ } )
57
69
} )
Original file line number Diff line number Diff line change @@ -168,6 +168,7 @@ export const TextAreaField = forwardRef<
168
168
name = "information"
169
169
size = { SPACING . spacing12 }
170
170
color = { COLORS . grey60 }
171
+ data-testid = "tooltip-icon"
171
172
/>
172
173
</ Flex >
173
174
< Tooltip tooltipProps = { tooltipProps } > { tooltipText } </ Tooltip >
@@ -186,7 +187,12 @@ export const TextAreaField = forwardRef<
186
187
>
187
188
{ leftIcon !== undefined && (
188
189
< Flex >
189
- < Icon name = { leftIcon } color = { COLORS . grey60 } size = "1.25rem" />
190
+ < Icon
191
+ name = { leftIcon }
192
+ color = { COLORS . grey60 }
193
+ size = "1.25rem"
194
+ data-testid = "left-icon"
195
+ />
190
196
</ Flex >
191
197
) }
192
198
< StyledTextArea
You can’t perform that action at this time.
0 commit comments