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): update handling of floated prop #1489

Merged
merged 2 commits into from
Mar 25, 2017
Merged

Conversation

layershifter
Copy link
Member

Fixes #1488.

floated class must be on wrapper if we have Label element, this PR update handling of this.

const rest = getUnhandledProps(Button, this.props)
const ElementType = getElementType(Button, this.props, () => {
if (!_.isNil(label) || !_.isNil(attached)) return 'div'
})
Copy link
Member Author

Choose a reason for hiding this comment

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

I've moved this inline function to method, so it will not be created on each render.

@codecov-io
Copy link

codecov-io commented Mar 21, 2017

Codecov Report

Merging #1489 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1489      +/-   ##
==========================================
- Coverage   99.74%   99.74%   -0.01%     
==========================================
  Files         141      141              
  Lines        2371     2364       -7     
==========================================
- Hits         2365     2358       -7     
  Misses          6        6
Impacted Files Coverage Δ
src/elements/Button/Button.js 100% <100%> (ø) ⬆️
src/elements/Button/ButtonOr.js 100% <0%> (ø) ⬆️
src/collections/Grid/GridRow.js 100% <0%> (ø) ⬆️
src/collections/Grid/GridColumn.js 100% <0%> (ø) ⬆️
src/elements/Input/Input.js 100% <0%> (ø) ⬆️
src/modules/Dropdown/Dropdown.js 100% <0%> (ø) ⬆️
src/addons/Portal/Portal.js 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fd65da...6adb5e6. Read the comment docs.

@@ -109,6 +109,11 @@ describe('Button', () => {
wrapper.find('Label').should.not.have.className('disabled')
wrapper.find('button').should.not.have.className('disabled')
})
it('contains children without floated class when floated attribute is set', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Would prefer we assert the expected location of the floated class in this test as well. It currently asserts where the className should not be, but doesn't assert where it should be.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated tests as you requested 👍

@levithomason levithomason merged commit 9c2a29f into master Mar 25, 2017
@levithomason levithomason deleted the fix/button branch March 25, 2017 03:41
@levithomason
Copy link
Member

Released in [email protected].

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

Successfully merging this pull request may close these issues.

3 participants