Skip to content

Commit

Permalink
Fixed button getStyle test.
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCStewart committed Nov 3, 2017
1 parent c5429cb commit c9e0517
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/button/get-styles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import { expect } from 'chai';
import getStyles from '../../src/button/get-styles';
import styles from '../../src/button/styles';
import colors from '../../src/settings/colors';
import darken from '../../src/internal/darken';
import fade from '../../src/internal/fade';
import internalStyles from '../../src/settings/styles';

describe('Button.getStyles', () => {
describe('root', () => {
Expand All @@ -21,18 +25,22 @@ describe('Button.getStyles', () => {
const style = getStyles.root('red');

expect(style).to.have.property('backgroundColor', 'red');
expect(style[':hover']).to.have.property('backgroundColor', darken('red', 0.15));
});

it('should add inverted styles', () => {
const style = getStyles.root('red', true);

expect(style).to.have.property('backgroundColor', '#FEFEFE');
expect(style).to.have.property('color', 'red');
expect(style).to.have.property('backgroundColor', colors.white);
expect(style[':hover']).to.have.property('backgroundColor', darken(colors.white, 0.15));
expect(style[':active']).to.have.property('boxShadow', internalStyles.depthShadows[1]);
});

it('should add iconButton styles', () => {
const style = getStyles.root('red', false, true);

expect(style).to.have.property('borderRadius', '50%');
expect(style).to.deep.equal(styles.iconButton);
});

it('should add disabled styles', () => {
Expand All @@ -45,6 +53,11 @@ describe('Button.getStyles', () => {
const style = getStyles.root('red', false, false, false, true);

expect(style).to.have.property('backgroundColor', 'transparent');
expect(style).to.have.property('boxShadow', 'none');
expect(style).to.have.property('textTransform', 'uppercase');
expect(style).to.have.property('flexShrink', 0);
expect(style[':hover']).to.have.property('backgroundColor', fade(colors.black, 0.95));
expect(style[':active']).to.have.property('backgroundColor', fade(colors.black, 0.85));
});
});
});

0 comments on commit c9e0517

Please sign in to comment.