File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
src/Common/SegmentedControl Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -25,13 +25,14 @@ const SegmentedControl = ({
25
25
tooltips,
26
26
disabled = false ,
27
27
rootClassName = '' ,
28
+ name,
28
29
variant = SegmentedControlVariant . WHITE_ON_GRAY ,
29
30
} : SegmentedControlProps ) => (
30
31
< StyledRadioGroup
31
32
className = { `${ variant } ${ rootClassName } ` }
32
33
onChange = { onChange }
33
34
initialTab = { initialTab }
34
- name = "segmented-control"
35
+ name = { name }
35
36
disabled = { disabled }
36
37
>
37
38
{ tabs . map ( ( tab : OptionType , index ) => (
@@ -41,6 +42,7 @@ const SegmentedControl = ({
41
42
className = "fs-12 cn-7 fw-6 lh-20"
42
43
showTippy = { ! ! tooltips ?. [ index ] }
43
44
tippyContent = { tooltips ?. [ index ] ?? '' }
45
+ dataTestId = { `${ name } -${ tab . value } ` }
44
46
>
45
47
{ tab . label }
46
48
</ StyledRadioGroup . Radio >
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export interface SegmentedControlProps {
26
26
tabs : OptionType [ ]
27
27
initialTab : string
28
28
onChange : ( e : React . ChangeEvent < HTMLInputElement > ) => void
29
+ name : string
29
30
tooltips ?: string [ ]
30
31
disabled ?: boolean
31
32
rootClassName ?: string
You can’t perform that action at this time.
0 commit comments