-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,9 +106,18 @@ describe('Button', () => { | |
}) | ||
it('contains children without disabled class when disabled attribute is set', () => { | ||
const wrapper = shallow(<Button label='hi' disabled />) | ||
|
||
wrapper.should.have.className('disabled') | ||
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', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated tests as you requested 👍 |
||
const wrapper = shallow(<Button label='hi' floated='left' />) | ||
|
||
wrapper.should.have.className('floated') | ||
wrapper.find('Label').should.not.have.className('floated') | ||
wrapper.find('button').should.not.have.className('floated') | ||
}) | ||
it('creates a basic pointing label', () => { | ||
shallow(<Button label='foo' />) | ||
.should.have.exactly(1).descendants('Label[basic][pointing]') | ||
|
There was a problem hiding this comment.
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.