File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import {shallow} from 'enzyme';
44import { assert } from 'chai' ;
55import FlatButton from './FlatButton' ;
66import getMuiTheme from '../styles/getMuiTheme' ;
7+ import ActionAndroid from '../svg-icons/action/android' ;
78
89describe ( '<FlatButton />' , ( ) => {
910 const muiTheme = getMuiTheme ( ) ;
@@ -92,6 +93,18 @@ describe('<FlatButton />', () => {
9293 assert . ok ( icon . is ( { color : flatButtonTheme . primaryTextColor } ) ) ;
9394 } ) ;
9495
96+ it ( 'colors the icon with the passed color in prop' , ( ) => {
97+ const wrapper = shallowWithContext (
98+ < FlatButton
99+ backgroundColor = "#a4c639"
100+ hoverColor = "#8AA62F"
101+ icon = { < ActionAndroid color = { 'white' } /> }
102+ />
103+ ) ;
104+ const icon = wrapper . children ( ) . at ( 0 ) ;
105+ assert . equal ( icon . prop ( 'color' ) , 'white' , 'icon should have same color as that of color prop' ) ;
106+ } ) ;
107+
95108 it ( 'colors the button the secondary theme color' , ( ) => {
96109 const wrapper = shallowWithContext (
97110 < FlatButton secondary = { true } icon = { < span className = "test-icon" /> } > Button</ FlatButton >
You can’t perform that action at this time.
0 commit comments