@@ -7,31 +7,32 @@ import userEvent from '@testing-library/user-event'
77import ChoiceFieldset , { Item , ChoiceFieldsetProps } from '../../deprecated/ChoiceFieldset'
88import { ChoiceFieldsetListProps } from '../../deprecated/ChoiceFieldset/ChoiceFieldsetList'
99
10- const SelectableChoicelistFieldset : React . FC < React . PropsWithChildren < ChoiceFieldsetProps & ChoiceFieldsetListProps > > =
11- ( { onSelect, selectionVariant, selected = [ ] } ) => {
12- const [ selectionVals , setSelectionVals ] = React . useState < string [ ] > ( selected )
10+ const SelectableChoicelistFieldset : React . FC <
11+ React . PropsWithChildren < ChoiceFieldsetProps & ChoiceFieldsetListProps >
12+ > = ( { onSelect, selectionVariant, selected = [ ] } ) => {
13+ const [ selectionVals , setSelectionVals ] = React . useState < string [ ] > ( selected )
1314
14- React . useEffect ( ( ) => {
15- onSelect && onSelect ( selectionVals )
16- } , [ onSelect , selectionVals ] )
15+ React . useEffect ( ( ) => {
16+ onSelect && onSelect ( selectionVals )
17+ } , [ onSelect , selectionVals ] )
1718
18- return (
19- < SSRProvider >
20- < ChoiceFieldset
21- onSelect = { selectedVals => {
22- setSelectionVals ( selectedVals )
23- } }
24- selected = { selectionVals }
25- >
26- < ChoiceFieldset . Legend > Legend</ ChoiceFieldset . Legend >
27- < ChoiceFieldset . List selectionVariant = { selectionVariant } >
28- < ChoiceFieldset . Item value = "labelOne" > Label one</ ChoiceFieldset . Item >
29- < ChoiceFieldset . Item value = "labelTwo" > Label two</ ChoiceFieldset . Item >
30- </ ChoiceFieldset . List >
31- </ ChoiceFieldset >
32- </ SSRProvider >
33- )
34- }
19+ return (
20+ < SSRProvider >
21+ < ChoiceFieldset
22+ onSelect = { selectedVals => {
23+ setSelectionVals ( selectedVals )
24+ } }
25+ selected = { selectionVals }
26+ >
27+ < ChoiceFieldset . Legend > Legend</ ChoiceFieldset . Legend >
28+ < ChoiceFieldset . List selectionVariant = { selectionVariant } >
29+ < ChoiceFieldset . Item value = "labelOne" > Label one</ ChoiceFieldset . Item >
30+ < ChoiceFieldset . Item value = "labelTwo" > Label two</ ChoiceFieldset . Item >
31+ </ ChoiceFieldset . List >
32+ </ ChoiceFieldset >
33+ </ SSRProvider >
34+ )
35+ }
3536
3637describe ( 'ChoiceFieldset' , ( ) => {
3738 it ( 'renders default' , ( ) => {
0 commit comments