forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
22 changes: 18 additions & 4 deletions
22
packages/mui-codemod/src/v5.0.0/joy-rename-components-to-slots.test/actual.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; |
22 changes: 18 additions & 4 deletions
22
packages/mui-codemod/src/v5.0.0/joy-rename-components-to-slots.test/expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; |