Last active
August 22, 2018 08:55
-
-
Save iamstarkov/93d7dca38c9f2db46c2f9e25754bb567 to your computer and use it in GitHub Desktop.
jss button testing https://github.com/cssinjs/react-jss/issues/93
This file contains hidden or 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
import injectSheet from 'react-jss' | |
import styles from './styles' | |
import Button from './button' | |
export default injectSheet(styles)(Button) |
This file contains hidden or 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
export default { | |
button: { | |
backgroundColor: props => props.bg | |
}, | |
block: { /* */ }, | |
active: { /* */ }, | |
disabled: { /* */ }, | |
} |
This file contains hidden or 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
import React from 'react'; | |
import test from 'ava'; | |
import styles from './styles'; | |
test('render root.backgroundColor with props.bg', t => { | |
const props = { | |
bg: 'red' | |
} | |
const actual = styles.root.backgroundColor(props); | |
const expected = props.bg; | |
t.is(actual, expected) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment