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

Add navigation component tests #24860

Merged

Conversation

joshuatf
Copy link
Contributor

@joshuatf joshuatf commented Aug 27, 2020

Description

Adds the navigation component tests.

How has this been tested?

Through...tests.

Testing

  1. Run npm run test-unit packages/components/src/navigation
  2. Make sure all tests pass.
  3. Make sure test coverage is adequate.

@joshuatf joshuatf force-pushed the add/nav-component-tests branch from 0068aa3 to 45d45fb Compare August 27, 2020 18:29
@psealock psealock added the [Feature] Navigation Component A navigational waterfall component for hierarchy of items. label Aug 30, 2020
@psealock
Copy link
Contributor

Nice @joshuatf, thanks for the added coverage. In 4c846b5 I went through the tests and changed a few things relating to queries and best practices. This is a really good guide https://kentcdodds.com/blog/common-mistakes-with-react-testing-library.

@psealock
Copy link
Contributor

I also added 2 tests for presence of an href and LinkComponent in a3d444c

@psealock psealock force-pushed the feature/navigation branch from 919ced3 to c77b558 Compare August 31, 2020 01:20
@psealock psealock force-pushed the add/nav-component-tests branch from 91b698a to d880c33 Compare August 31, 2020 01:25
@psealock
Copy link
Contributor

psealock commented Aug 31, 2020

🎉 These tests found their first 🐞 introduced in #24878 . Tests were failing due to a null value passed to Button's href. Button has an explicit check for undefined, so the null was causing an anchor tag where it should have been a button tag.

Fixed in aa4ab1f

@psealock psealock merged commit 80273e2 into WordPress:feature/navigation Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Navigation Component A navigational waterfall component for hierarchy of items.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants