Skip to content

Commit 9b37deb

Browse files
committed
[Checkbox] Add test showcase for checked checkbox
1 parent a4e3771 commit 9b37deb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/material-ui/src/Checkbox/Checkbox.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ describe('<Checkbox />', () => {
3232
expect(typeof classes.disabled).to.equal('string');
3333
});
3434

35+
it('renders an unchecked `checkbox` by default', () => {
36+
const { getByRole } = render(<Checkbox />);
37+
38+
expect(getByRole('checkbox')).to.have.property('checked', false);
39+
});
40+
41+
it('renders an checked `checkbox` when `checked={true}`', () => {
42+
const { getByRole } = render(<Checkbox checked />);
43+
44+
expect(getByRole('checkbox')).to.have.property('checked', true);
45+
});
46+
3547
describe('prop: indeterminate', () => {
3648
it('should render an indeterminate icon', () => {
3749
const { container } = render(<Checkbox indeterminate />);

0 commit comments

Comments
 (0)