Skip to content

Heading tests, testing cleanup #41

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

Merged
merged 10 commits into from
May 31, 2018
Merged

Heading tests, testing cleanup #41

merged 10 commits into from
May 31, 2018

Conversation

shawnbot
Copy link
Contributor

@shawnbot shawnbot commented May 25, 2018

  1. Removes the Heading.h{1-6} and updates the examples to use the <Heading tag='h{1-6}'> form.
  2. Adds a test suite for the Heading component and generalizes some of the testing utility functions so we don't have a render() function defined in each of our component test files.

Note that if we change the defaultProps for any of our headings now, we'll probably need to update the tests. The tests are also a bit brittle in that rendered classnames are expected to be in a specific order. We need to decide whether this is important and update the equality tests accordingly (for instance, using a Set to compare equality instead of an array).

@shawnbot shawnbot requested a review from a team May 25, 2018 22:16
@shawnbot
Copy link
Contributor Author

Also, why isn't this branch being built by Travis? 🤔

@shawnbot shawnbot added the ⭐️rep an industry leading reputation label May 25, 2018
@jonrohan
Copy link
Member

Also, why isn't this branch being built by Travis?

We don't have private repositories turned on for travis-ci 🤑

@shawnbot
Copy link
Contributor Author

We do, though! https://travis-ci.com/primer/primer-react

@shawnbot
Copy link
Contributor Author

Ahhhh:

Free for open source, and with a 100 build trial for private projects, getting setup takes just 2 minutes.

@shawnbot
Copy link
Contributor Author

Anyway, how about a review? 😊

@shawnbot shawnbot mentioned this pull request May 30, 2018
src/Heading.js Outdated
Heading.h3.defaultProps = {m: 0, fontSize: 3}
Heading.h4.defaultProps = {m: 0, fontSize: 2}
Heading.h5.defaultProps = {m: 0, fontSize: 1}
Heading.h6.defaultProps = {m: 0, fontSize: 0}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: don't tie font size to heading level. We want people to be more intentional about how they use headings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want this:

<Heading tag='h1' fontSize={6} />

@jonrohan jonrohan changed the base branch from master to release-0.2.0-beta May 31, 2018 21:43
Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

Clean up based on review meeting and ship to the release branch. Then I'll update my prs

@shawnbot shawnbot merged commit d18bdcb into release-0.2.0-beta May 31, 2018
@shawnbot shawnbot deleted the heading-tests branch May 31, 2018 21:48
@jonrohan jonrohan mentioned this pull request Jun 1, 2018
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐️rep an industry leading reputation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants