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

[core] [Label] render label element instead of div #1972

Merged

Conversation

gianmarcotoso
Copy link
Contributor

Fixes #1971

Fixes #1971

Changes proposed in this pull request:

The Label component originally returned a div element, which was not supported by the .pt-label selector. I modified the label.tsx file so that it returns a label element instead of a div.

Reviewers should focus on:

I have written some tests for the Label component (which were previously missing), but they are very naïve. Maybe there's more stuff that could be tested.

@palantirtech
Copy link
Member

Thanks for your interest in palantir/blueprint, @gianmarcotoso! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@gianmarcotoso
Copy link
Contributor Author

It's failing on the DateRangePicker, which I haven't even touched (and it's not part of the core). Is this failing on the master branch as well?

@adidahiya adidahiya changed the base branch from master to develop January 15, 2018 17:10
Copy link
Contributor

@cmslewis cmslewis left a comment

Choose a reason for hiding this comment

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

Code changes LGTM. Thanks! FYI @gianmarcotoso We ultimately omitted tests after initially writing them because of the trivial nature of the component. I'm open to including tests personally, but let's wait to hear from @adidahiya.


import { Classes, Label } from "../../src/index";

describe("<Label>", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@adidahiya FYI these tests

@adidahiya adidahiya self-assigned this Jan 17, 2018
@giladgray
Copy link
Contributor

@gianmarcotoso what's the status of this PR? first step for you is to merge latest develop, which should resolve build issues. please close this PR if you don't have time to finish it and i'll pick up this feature (encountered this issue in my own app development 😄 )

@gianmarcotoso
Copy link
Contributor Author

gianmarcotoso commented Jan 29, 2018 via email

@gianmarcotoso
Copy link
Contributor Author

gianmarcotoso commented Jan 30, 2018

So, I did pull the latest develop into my branch and launched yarn verify but it now fails 2 tests on the Overlay component:

✖ does not bring focus to overlay if autoFocus=false
✖ returns focus to overlay after clicking the backdrop if enforceFocus=true

I don't think these are related to my changes, do you get them as well?

@giladgray
Copy link
Contributor

@gianmarcotoso push it up! let's see if it fails on circle. those two tests are flaky, particularly when run in chrome (local) vs phantom (circle).

@gianmarcotoso
Copy link
Contributor Author

Nope, still borked - even though only one is failing now, still on the Overlay.

@adidahiya
Copy link
Contributor

Not your fault on the broken unit test -- I think it's broken on develop.

Regarding the unit tests -- yes, they are too simple. Please remove them, I don't think it's worth keeping around tautological tests that just verify the basic structure of the component.

@gianmarcotoso
Copy link
Contributor Author

Ok, I'll remove the tests, merge develop again for good measure and push again later today (hopefully!)

@giladgray
Copy link
Contributor

@gianmarcotoso still waiting on that push...

@gianmarcotoso
Copy link
Contributor Author

gianmarcotoso commented Feb 2, 2018

Sorry, pushed right now!

Edit: and the checks have passed! 🎉

@adidahiya adidahiya changed the title make label component return a label element instead of a div [core] [Label] render label element instead of div Feb 2, 2018
@adidahiya adidahiya merged commit a003d54 into palantir:develop Feb 2, 2018
@adidahiya
Copy link
Contributor

thanks @gianmarcotoso!

@gianmarcotoso
Copy link
Contributor Author

You're welcome, thank you for Blueprint! :)

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.

5 participants