Skip to content

Commit c3b09f7

Browse files
committed
Improve codemod test
1 parent 25e2e76 commit c3b09f7

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
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>;
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
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>;

0 commit comments

Comments
 (0)