-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4043 from echenley/feature/floatingLabelFocusStyle
[TextField] add floatingLabelFocusStyle prop
- Loading branch information
Showing
4 changed files
with
85 additions
and
36 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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* eslint-env mocha */ | ||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import {expect} from 'chai'; | ||
import TextFieldLabel from './TextFieldLabel'; | ||
import getMuiTheme from '../styles/getMuiTheme'; | ||
|
||
describe('<TextFieldLabel>', () => { | ||
it('uses focus styles', () => { | ||
const wrapper = shallow( | ||
<TextFieldLabel | ||
muiTheme={getMuiTheme()} | ||
shrink={false} | ||
style={{color: 'regularcolor'}} | ||
shrinkStyle={{color: 'focuscolor'}} | ||
/> | ||
); | ||
|
||
expect(wrapper.type()).to.equal('label'); | ||
expect(wrapper.prop('style').color).to.equal('regularcolor'); | ||
|
||
wrapper.setProps({shrink: true}); | ||
expect(wrapper.prop('style').color).to.equal('focuscolor'); | ||
}); | ||
}); |