Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Button): render labeled as a <button> #597

Merged
merged 4 commits into from
Oct 3, 2016
Merged

fix(Button): render labeled as a <button> #597

merged 4 commits into from
Oct 3, 2016

Conversation

dmitriyshx
Copy link
Contributor

Fix switch button to div
#596

fix switch button to div
@codecov-io
Copy link

codecov-io commented Oct 3, 2016

Current coverage is 100% (diff: 100%)

Merging #597 into master will not change coverage

@@           master   #597   diff @@
====================================
  Files         119    119          
  Lines        1915   1915          
  Methods         0      0          
  Messages        0      0          
  Branches        0      0          
====================================
  Hits         1915   1915          
  Misses          0      0          
  Partials        0      0          

Powered by Codecov. Last update 6c72147...81b9150

Copy link
Member

@levithomason levithomason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, just need a test for this. See test/specs/elements/Button. Should be a very simply copy/paste update of one of the existing tests.
Add your review

@dmitriyshx
Copy link
Contributor Author

Should work in production this trick fixed the problem.

wrapper.should.have.tagName('button')
wrapper.should.have.className('labeled')
wrapper.should.have.exactly(1).descendants('Icon')
})
Copy link
Member

@levithomason levithomason Oct 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the test, let's simplify it a bit. It is best to write tests that are as minimal as possible and assert one thing. This makes them stronger and more maintainable.

In this case, most of the assertions made here are covered by other existing tests, all we should need to assert is that a labeled button renders a button element:

it('renders as a button', () => {
  shallow(<Button labeled />)
    .should.have.tagName('button')
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made

@levithomason levithomason changed the title feat(Button): fix switch button to div fix(Button): render labeled as a <button> Oct 3, 2016
@levithomason
Copy link
Member

One linter issue:

image

@levithomason
Copy link
Member

levithomason commented Oct 3, 2016

Also, if the description of this PR were updated slightly, it will auto close the related issue on merge:

Fix switch button to div 
#596
Fixes #596 switch button to div 

https://github.com/blog/1506-closing-issues-via-pull-requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants