Skip to content

Commit d015bc5

Browse files
committed
Test slots of Alert
1 parent a301e2c commit d015bc5

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

packages/mui-joy/src/Alert/Alert.test.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,31 @@ import { createRenderer, describeConformance } from 'test/utils';
44
import { ThemeProvider } from '@mui/joy/styles';
55
import Alert, { alertClasses as classes } from '@mui/joy/Alert';
66
import { unstable_capitalize as capitalize } from '@mui/utils';
7+
import WarningIcon from '@mui/icons-material/Warning';
78

89
describe('<Alert />', () => {
910
const { render } = createRenderer();
1011

11-
describeConformance(<Alert />, () => ({
12-
classes,
13-
inheritComponent: 'div',
14-
render,
15-
ThemeProvider,
16-
muiName: 'JoyAlert',
17-
refInstanceof: window.HTMLDivElement,
18-
testComponentPropWith: 'span',
19-
testVariantProps: { variant: 'solid' },
20-
testCustomVariant: true,
21-
skip: ['classesRoot', 'componentsProp'],
22-
}));
12+
describeConformance(
13+
<Alert startDecorator={<WarningIcon />} endDecorator={<WarningIcon />} />,
14+
() => ({
15+
classes,
16+
inheritComponent: 'div',
17+
render,
18+
ThemeProvider,
19+
muiName: 'JoyAlert',
20+
refInstanceof: window.HTMLDivElement,
21+
testComponentPropWith: 'span',
22+
testVariantProps: { variant: 'solid' },
23+
testCustomVariant: true,
24+
slots: {
25+
root: { expectedClassName: classes.root },
26+
startDecorator: { expectedClassName: classes.startDecorator },
27+
endDecorator: { expectedClassName: classes.endDecorator },
28+
},
29+
skip: ['classesRoot', 'componentsProp'],
30+
}),
31+
);
2332

2433
describe('prop: variant', () => {
2534
it('soft by default', () => {

0 commit comments

Comments
 (0)