Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: use expect and rtl completely
  • Loading branch information
eps1lon committed Apr 15, 2020
commit a4e3771f63a161f05db4712d0217f3cfc9546ee3
14 changes: 8 additions & 6 deletions packages/material-ui/src/Checkbox/Checkbox.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { assert, expect } from 'chai';
import { expect } from 'chai';
import { getClasses, createMount } from '@material-ui/core/test-utils';
import describeConformance from '../test-utils/describeConformance';
import { createClientRender } from 'test/utils/createClientRender';
Expand Down Expand Up @@ -27,15 +27,17 @@ describe('<Checkbox />', () => {
}));

it('should have the classes required for Checkbox', () => {
assert.strictEqual(typeof classes.root, 'string');
assert.strictEqual(typeof classes.checked, 'string');
assert.strictEqual(typeof classes.disabled, 'string');
expect(typeof classes.root).to.equal('string');
expect(typeof classes.checked).to.equal('string');
expect(typeof classes.disabled).to.equal('string');
});

describe('prop: indeterminate', () => {
it('should render an indeterminate icon', () => {
const wrapper = mount(<Checkbox indeterminate />);
assert.strictEqual(wrapper.find('svg[data-mui-test="IndeterminateCheckBoxIcon"]').length, 1);
const { container } = render(<Checkbox indeterminate />);
expect(
container.querySelector('svg[data-mui-test="IndeterminateCheckBoxIcon"]'),
).not.to.equal(null);
});
});

Expand Down