Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Feb 12, 2021
1 parent 6bc5ae5 commit 785d733
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions packages/material-ui/src/FormLabel/FormLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const FormLabel = React.forwardRef(function FormLabel(inProps, ref) {
const styleProps = {
...props,
component,
color: fcs.color = 'primary',
color: fcs.color || 'primary',
disabled: fcs.disabled,
error: fcs.error,
filled: fcs.filled,
Expand All @@ -118,11 +118,7 @@ const FormLabel = React.forwardRef(function FormLabel(inProps, ref) {
>
{children}
{fcs.required && (
<AsteriskComponent
styleProps={styleProps}
aria-hidden
className={classes.asterisk}
>
<AsteriskComponent styleProps={styleProps} aria-hidden className={classes.asterisk}>
&thinsp;{'*'}
</AsteriskComponent>
)}
Expand Down
3 changes: 1 addition & 2 deletions packages/material-ui/src/FormLabel/FormLabel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ describe('<FormLabel />', () => {
describe('prop: color', () => {
it('should have color secondary class', () => {
const { container } = render(<FormLabel color="secondary" />);
expect(container.querySelectorAll(`.${classes.colorSecondary}`)).to.have.lengthOf(1);
expect(container.querySelector(`.${classes.root}`)).to.have.class(classes.colorSecondary);
expect(container.firstChild).to.have.class(classes.colorSecondary);
});

it('should have the focused class and style', () => {
Expand Down

0 comments on commit 785d733

Please sign in to comment.