Skip to content

Commit

Permalink
fix(ffe-buttons-react): Remove type propType check
Browse files Browse the repository at this point in the history
This version removes the propType validation of the `type` property. It
makes sense if the element type is `button`, but now that consumers can
override the element type we run the risk of throwing propType errors
for valid values of `type` for element types we don't know about (custom
components for instance).
  • Loading branch information
wkillerud committed Feb 2, 2018
1 parent 55ba579 commit 005890a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion packages/ffe-buttons-react/src/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ Button.propTypes = {
* Used internally by the different components in order to not render needless stuff for e.g. tertiary button.
*/
simpleContent: bool.isRequired,
type: oneOf(['button', 'submit', 'reset']),
};

Button.defaultProps = {
Expand Down
17 changes: 0 additions & 17 deletions packages/ffe-buttons-react/src/Button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,6 @@ describe('Button', () => {
});
});

describe('type', () => {
it('can be type="button"', () => {
const wrapper = shallow(<Button type="button" />);
expect(wrapper.find('button').is('[type="button"]')).to.be.true;
});

it('can be type="reset"', () => {
const wrapper = shallow(<Button type="reset" />);
expect(wrapper.find('button').is('[type="reset"]')).to.be.true;
});

it('can be type="submit"', () => {
const wrapper = shallow(<Button type="submit" />);
expect(wrapper.find('button').is('[type="submit"]')).to.be.true;
});
});

describe('autoFocus', () => {
it('can be autoFocused', () => {
const wrapper = shallow(<Button autoFocus={true} />);
Expand Down

0 comments on commit 005890a

Please sign in to comment.