Skip to content

Commit

Permalink
Issue #552 checkbox (#962)
Browse files Browse the repository at this point in the history
* Fixed getStyles test.

* New structure for correct testing.
  • Loading branch information
IanCStewart authored and Sjaak Luthart committed Nov 10, 2017
1 parent ac213b1 commit fb8f5db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
10 changes: 1 addition & 9 deletions src/checkbox/index.jsx → src/checkbox/component.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import Radium from 'radium';
import compose from 'recompose/compose';
import getStyles from './get-styles';
import IconCheckbox from '../icons/icon-checkbox';
import styles from './styles';
import themeable from '../themeable';

/** A checkbox is used to verify which options you want selected from a group. */
const Checkbox = ({
Expand Down Expand Up @@ -69,9 +66,4 @@ Checkbox.defaultProps = {
checked: false
};

const enhance = compose(
themeable(),
Radium
);

export default enhance(Checkbox);
export default Checkbox;
11 changes: 11 additions & 0 deletions src/checkbox/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Radium from 'radium';
import compose from 'recompose/compose';
import themeable from '../themeable';
import Checkbox from './component';

const enhance = compose(
themeable(),
Radium
);

export default enhance(Checkbox);
6 changes: 3 additions & 3 deletions test/checkbox/get-styles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ describe('Checkbox.getStyles', () => {
});

it('should combine styles', () => {
const style = getStyles.root('red', { color: 'red' });
const style = getStyles.root(null, { color: 'red' });

expect(style).to.have.property('color', 'red');
});

it('should change theme color', () => {
const style = getStyles.root('red');
const style = getStyles.root('HotPink');

expect(style[':hover']).to.have.property('color', 'red');
expect(style[':hover']).to.have.property('color', 'HotPink');
});
});

Expand Down

0 comments on commit fb8f5db

Please sign in to comment.