Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj committed Aug 29, 2022
1 parent c938225 commit 72c24b1
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions packages/mui-joy/src/Breadcrumbs/Breadcrumbs.test.js
Expand Up @@ -16,27 +16,20 @@ describe('<Breadcrumbs />', () => {
muiName: 'JoyBreadcrumbs',
refInstanceof: window.HTMLElement,
testVariantProps: { variant: 'solid' },
skip: [
'classesRoot',
'componentProp',
'componentsProp',
'themeDefaultProps',
'themeVariants',
'themeStyleOverrides',
],
skip: ['classesRoot', 'componentProp', 'componentsProp', 'themeDefaultProps'],
}));

describe('prop: size', () => {
it('md by default', () => {
const { getByTestId } = render(<Breadcrumbs data-testid="root" />);
const { getByRole } = render(<Breadcrumbs />);

expect(getByTestId('root')).to.have.class(classes.sizeMd);
expect(getByRole('navigation')).to.have.class(classes.sizeMd);
});
['sm', 'md', 'lg'].forEach((size) => {
it(`should render ${size}`, () => {
const { getByTestId } = render(<Breadcrumbs data-testid="root" size={size} />);
const { getByRole } = render(<Breadcrumbs size={size} />);

expect(getByTestId('root')).to.have.class(classes[`size${capitalize(size)}`]);
expect(getByRole('navigation')).to.have.class(classes[`size${capitalize(size)}`]);
});
});
});
Expand Down

0 comments on commit 72c24b1

Please sign in to comment.