Created
January 14, 2016 19:07
-
-
Save nackjicholson/d106d699ea7d2ee832ac to your computer and use it in GitHub Desktop.
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
| // ... | |
| function createComponent(customProps = {}) { | |
| const props = Object.assign({ baseId: 'test-baseId' }, customProps); | |
| const StatelessRadio = statelessRadio(React); | |
| return <StatelessRadio {...props} />; | |
| } | |
| describe('statelessRadio', () => { | |
| // ... | |
| it('should render a wrapper div with id equal to baseId prop', () => { | |
| const component = createComponent(); | |
| // ... | |
| }); | |
| it('should render a p tag with the text from the titleText prop', () => { | |
| const props = { titleText: 'test.title' }; | |
| const component = createComponent(props); | |
| // ... | |
| }); | |
| it('should render radio inputs and their labels from the inputs prop', () => { | |
| const props = { | |
| inputs: [ | |
| { value: 'alpha.value', label: 'alpha.label' }, | |
| { value: 'bravo.value', label: 'bravo.label' }, | |
| { value: 'charlie.value', label: 'charlie.label' } | |
| ] | |
| }; | |
| const component = createComponent(props); | |
| const $component = $(component).render(); | |
| // ... | |
| }); | |
| // ... | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment