Skip to content

Commit

Permalink
test case added
Browse files Browse the repository at this point in the history
  • Loading branch information
anuujj committed Jul 8, 2024
1 parent 088f128 commit bb2a912
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/mui-material/src/Divider/Divider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ import { expect } from 'chai';
import { createRenderer } from '@mui/internal-test-utils';
import Divider, { dividerClasses as classes } from '@mui/material/Divider';
import describeConformance from '../../test/describeConformance';
import { styled } from '..';

describe('<Divider />', () => {
const { render } = createRenderer();
const StyledDivider = styled(Divider)(() => ({
'&::before': {
width: '4.75rem',
flex: '0 0 3.75rem',
},
borderStyle: `dashed`,
}));

describeConformance(<Divider />, () => ({
classes,
Expand Down Expand Up @@ -83,6 +91,30 @@ describe('<Divider />', () => {
expect(container.querySelectorAll(`.${classes.textAlignLeft}`).length).to.equal(0);
});
});

describe('styled border: borderStyle dashed', () => {
before(function beforeHook() {
if (/jsdom/.test(window.navigator.userAgent)) {
this.skip();
}
});

it('should set the border-style dashed in before and after pseudoclass', () => {
const { container } = render(<StyledDivider>content</StyledDivider>);
getComputedStyle(container.firstChild, '::before')
.getPropertyValue('border-top-style')
.should.equal('dashed');
getComputedStyle(container.firstChild, '::before')
.getPropertyValue('border-left-style')
.should.equal('dashed');
getComputedStyle(container.firstChild, '::after')
.getPropertyValue('border-top-style')
.should.equal('dashed');
getComputedStyle(container.firstChild, '::after')
.getPropertyValue('border-left-style')
.should.equal('dashed');
});
});
});

describe('prop: variant', () => {
Expand Down

0 comments on commit bb2a912

Please sign in to comment.