Skip to content

Commit

Permalink
[Checkbox][Radio] Fix describeConformance by adding after callback
Browse files Browse the repository at this point in the history
  • Loading branch information
rostislavbobo committed Jan 23, 2020
1 parent 85ea482 commit b3cd783
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
12 changes: 3 additions & 9 deletions packages/material-ui/src/Checkbox/Checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import describeConformance from '../test-utils/describeConformance';
import { createClientRender } from 'test/utils/createClientRender';
import Checkbox from './Checkbox';
import FormControl from '../FormControl';
import IconButton from '../IconButton';

describe('<Checkbox />', () => {
const render = createClientRender();
Expand All @@ -16,21 +17,14 @@ describe('<Checkbox />', () => {
mount = createMount({ strict: true });
});

describeConformance(<Checkbox />, () => ({
mount,
only: ['refForwarding'],
refInstanceof: window.HTMLSpanElement,
after: () => mount.cleanUp(),
}));

/* TODO Checkbox violates root component
describeConformance(<Checkbox checked />, () => ({
classes,
inheritComponent: IconButton,
mount,
refInstanceof: window.HTMLSpanElement,
skip: ['componentProp'],
})); */
after: () => mount.cleanUp(),
}));

it('should have the classes required for Checkbox', () => {
assert.strictEqual(typeof classes.root, 'string');
Expand Down
12 changes: 3 additions & 9 deletions packages/material-ui/src/Radio/Radio.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getClasses, createMount } from '@material-ui/core/test-utils';
import describeConformance from '@material-ui/core/test-utils/describeConformance';
import { createClientRender } from 'test/utils/createClientRender';
import FormControl from '../FormControl';
import IconButton from '../IconButton';
import Radio from './Radio';

describe('<Radio />', () => {
Expand All @@ -16,21 +17,14 @@ describe('<Radio />', () => {
mount = createMount({ strict: true });
});

describeConformance(<Radio />, () => ({
mount,
only: ['refForwarding'],
refInstanceof: window.HTMLSpanElement,
after: () => mount.cleanUp(),
}));

/* TODO Radio violates root component
describeConformance(<Radio />, () => ({
classes,
inheritComponent: IconButton,
mount,
refInstanceof: window.HTMLSpanElement,
skip: ['componentProp'],
})); */
after: () => mount.cleanUp(),
}));

describe('styleSheet', () => {
it('should have the classes required for SwitchBase', () => {
Expand Down

0 comments on commit b3cd783

Please sign in to comment.