Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FilledInput] Fix disableUnderline property (#13719)
* [InputBase] Remove props capturing of disableUnderline * [FilledInput] Add conditional logic to remove underline in filled input * Update FilledInput.js * Update FilledInput.js * let's merge
- Loading branch information
1 parent
2ce70f0
commit 53e44d5
Showing
8 changed files
with
31 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
import React from 'react'; | ||
import { assert } from 'chai'; | ||
import { createShallow } from '@material-ui/core/test-utils'; | ||
import { createMount, createShallow, getClasses } from '@material-ui/core/test-utils'; | ||
import InputBase from '../InputBase'; | ||
import FilledInput from './FilledInput'; | ||
|
||
describe('<FilledInput />', () => { | ||
let classes; | ||
let shallow; | ||
let mount; | ||
|
||
before(() => { | ||
shallow = createShallow({ untilSelector: 'FilledInput' }); | ||
mount = createMount(); | ||
classes = getClasses(<FilledInput />); | ||
}); | ||
|
||
after(() => { | ||
mount.cleanUp(); | ||
}); | ||
|
||
it('should render a <div />', () => { | ||
const wrapper = shallow(<FilledInput />); | ||
assert.strictEqual(wrapper.type(), InputBase); | ||
assert.include(wrapper.props().classes.root, classes.underline); | ||
}); | ||
|
||
it('should disable the underline', () => { | ||
const wrapper = shallow(<FilledInput disableUnderline />); | ||
assert.notInclude(wrapper.props().classes.root, classes.underline); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters