Skip to content

Commit

Permalink
Improve tests for codemod
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj committed Dec 4, 2022
1 parent 60ea322 commit a3b40eb
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<Autocomplete
components={{ Root, Input: CustomInput }}
componentsProps={{ root: { className: 'root' }, input: { 'data-testid': 'input' } }}
/>;
// the codemod should transform only Joy UI components;
import { Alert as JoyAlert } from '@mui/joy';
import JoyAutocomplete from '@mui/joy/Autocomplete';
import CustomComponent from 'components/Custom';

<div>
<JoyAlert
components={{ Root, Input: CustomInput }}
componentsProps={{ root: { className: 'root' }, input: { 'data-testid': 'input' } }}
/>
<JoyAutocomplete
components={{ Root, Input: CustomInput }}
componentsProps={{ root: { className: 'root' }, input: { 'data-testid': 'input' } }}
/>
<CustomComponent
componentsProps={{ root: { className: 'root' }, input: { 'data-testid': 'input' } }}
/>
</div>;
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<Autocomplete
slots={{ root: Root, input: CustomInput }}
slotProps={{ root: { className: 'root' }, input: { 'data-testid': 'input' } }}
/>;
// the codemod should transform only Joy UI slots;
import { Alert as JoyAlert } from '@mui/joy';
import JoyAutocomplete from '@mui/joy/Autocomplete';
import CustomComponent from 'components/Custom';

<div>
<JoyAlert
slots={{ Root, Input: CustomInput }}
slotProps={{ root: { className: 'root' }, input: { 'data-testid': 'input' } }}
/>
<JoyAutocomplete
slots={{ Root, Input: CustomInput }}
slotProps={{ root: { className: 'root' }, input: { 'data-testid': 'input' } }}
/>
<CustomComponent
slotProps={{ root: { className: 'root' }, input: { 'data-testid': 'input' } }}
/>
</div>;

0 comments on commit a3b40eb

Please sign in to comment.