File tree Expand file tree Collapse file tree 2 files changed +38
-8
lines changed
packages/mui-codemod/src/v5.0.0/joy-rename-components-to-slots.test Expand file tree Collapse file tree 2 files changed +38
-8
lines changed Original file line number Diff line number Diff line change 1
- < Autocomplete
2
- components = { { Root, Input : CustomInput } }
3
- componentsProps = { { root : { className : 'root' } , input : { 'data-testid' : 'input' } } }
4
- /> ;
1
+ // the codemod should transform only Joy UI components;
2
+ import { Alert as JoyAlert } from '@mui/joy' ;
3
+ import JoyAutocomplete from '@mui/joy/Autocomplete' ;
4
+ import CustomComponent from 'components/Custom' ;
5
+
6
+ < div >
7
+ < JoyAlert
8
+ components = { { Root, Input : CustomInput } }
9
+ componentsProps = { { root : { className : 'root' } , input : { 'data-testid' : 'input' } } }
10
+ />
11
+ < JoyAutocomplete
12
+ components = { { Root, Input : CustomInput } }
13
+ componentsProps = { { root : { className : 'root' } , input : { 'data-testid' : 'input' } } }
14
+ />
15
+ < CustomComponent
16
+ components = { { Root, Input : CustomInput } }
17
+ componentsProps = { { root : { className : 'root' } , input : { 'data-testid' : 'input' } } }
18
+ />
19
+ </ div > ;
Original file line number Diff line number Diff line change 1
- < Autocomplete
2
- slots = { { root : Root , input : CustomInput } }
3
- slotProps = { { root : { className : 'root' } , input : { 'data-testid' : 'input' } } }
4
- /> ;
1
+ // the codemod should transform only Joy UI components;
2
+ import { Alert as JoyAlert } from '@mui/joy' ;
3
+ import JoyAutocomplete from '@mui/joy/Autocomplete' ;
4
+ import CustomComponent from 'components/Custom' ;
5
+
6
+ < div >
7
+ < JoyAlert
8
+ slots = { { root : Root , input : CustomInput } }
9
+ slotProps = { { root : { className : 'root' } , input : { 'data-testid' : 'input' } } }
10
+ />
11
+ < JoyAutocomplete
12
+ slots = { { root : Root , input : CustomInput } }
13
+ slotProps = { { root : { className : 'root' } , input : { 'data-testid' : 'input' } } }
14
+ />
15
+ < CustomComponent
16
+ components = { { Root, Input : CustomInput } }
17
+ componentsProps = { { root : { className : 'root' } , input : { 'data-testid' : 'input' } } }
18
+ />
19
+ </ div > ;
You can’t perform that action at this time.
0 commit comments