This repository has been archived by the owner on Aug 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeason Centaure
committed
Feb 1, 2018
1 parent
487e392
commit 7225d84
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
const NextButton = ({ disabled }) => <button disabled={disabled}>Next</button> | ||
|
||
NextButton.propTypes = { | ||
disabled: PropTypes.bool, | ||
} | ||
|
||
export default NextButton |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { shallow } from 'enzyme' | ||
import React from 'react' | ||
import NextButton from './NextButton' | ||
|
||
describe('#NextButton', () => { | ||
it('should render a button that can be disabled', () => { | ||
const wrapper = shallow( | ||
<div> | ||
<NextButton disabled /> | ||
<NextButton /> | ||
</div>, | ||
) | ||
const buttons = wrapper.find('NextButton') | ||
expect(buttons.at(0).props().disabled).toBe(true) | ||
expect(buttons.at(1).props().disabled).toBeUndefined() | ||
}) | ||
}) |
This file contains 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