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

Fixed: Ensure Header component uses proper semantic header HTML tag #3533

Merged
merged 6 commits into from
Jul 20, 2023

Conversation

amarmanhala
Copy link
Contributor

Changed div tag to HTML semantic element for Header component

Issue #2870

Merge checklist

  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@amarmanhala amarmanhala requested review from a team and joshblack July 18, 2023 00:11
@changeset-bot
Copy link

changeset-bot bot commented Jul 18, 2023

🦋 Changeset detected

Latest commit: 63b936a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@amarmanhala amarmanhala temporarily deployed to github-pages July 18, 2023 00:17 — with GitHub Actions Inactive
@amarmanhala
Copy link
Contributor Author

Hi @joshblack, This is my PR. Please can you guide me if there is anything that I missed or any advice? Thanks

Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for doing this 🥳

@joshblack
Copy link
Member

For the test failure, I think all that's left to do is update the snapshots for the header tests! You can do this by running the following command:

npm test -- -u

And then including the snapshots in a commit and pushing them up to this Pull Request. Hope that makes sense, let me know if you have any questions!

@amarmanhala amarmanhala temporarily deployed to github-pages July 18, 2023 23:06 — with GitHub Actions Inactive
@amarmanhala amarmanhala temporarily deployed to github-pages July 18, 2023 23:07 — with GitHub Actions Inactive
@amarmanhala amarmanhala requested a review from joshblack July 19, 2023 02:09
@amarmanhala amarmanhala temporarily deployed to github-pages July 19, 2023 02:16 — with GitHub Actions Inactive
@amarmanhala
Copy link
Contributor Author

Thank you @joshblack for your guidance 🤗. I have committed test snapshots now. Hopefully, it works now.

@joshblack
Copy link
Member

@amarmanhala seems like just one final change, in the test file for Header (src/__tests__/Header.test.tsx) there is a test that asserts on the tagName that needs to be updated:

  it('renders a <div> and <a>', () => {
-    expect(render(<Header />).type).toEqual('div')
+    expect(render(<Header />).type).toEqual('header')
    expect(render(<Header.Link />).type).toEqual('a')
  })

After that you should be good to go! 🥳

@amarmanhala amarmanhala temporarily deployed to github-pages July 19, 2023 23:21 — with GitHub Actions Inactive
@amarmanhala amarmanhala temporarily deployed to github-pages July 20, 2023 01:26 — with GitHub Actions Inactive
@amarmanhala
Copy link
Contributor Author

Thank you @joshblack for your guidance.

@joshblack joshblack enabled auto-merge July 20, 2023 14:43
@joshblack joshblack added this pull request to the merge queue Jul 20, 2023
Merged via the queue into primer:main with commit 33b6055 Jul 20, 2023
@primer-css primer-css mentioned this pull request Jul 20, 2023
@joshblack
Copy link
Member

Thanks so much for your contribution @amarmanhala! 🙌 🥳

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.

2 participants