nodejs.dev icon indicating copy to clipboard operation
nodejs.dev copied to clipboard

Add missing unit tests for pages and components

Open ovflowd opened this issue 3 years ago • 5 comments

Whilst in these last 3 months we overly focused on adding new features, content and structure to the Nodejs.dev repository, we gave a strong oversight to the unit testing side of it.

Several Components lack Unit Tests and some pages too. This Issue is simple, just add unit tests. With some caveats:

  • For Pages, we simply unit test that they're rendering as normal
  • For Components, we test that they're working correctly with their required props, and if possible some combination of props.
  • Some Components with existing unit tests need to have more tests added to cover extra content (E.g.: The SideBar component has new sections, and items and we need to test those also show as expected).

ovflowd avatar Sep 10 '22 20:09 ovflowd

As this is a good one for hacktoberfest would it be wise to break it down into smaller issues and explicitly state which components and pages need tests adding and make an issue for each one?

EmmaDawsonDev avatar Sep 17 '22 12:09 EmmaDawsonDev

That's a great suggestion. I actually wanted to do this but haven't had time before, going to write up all the affected components and add sub-tasks for each one.

ovflowd avatar Sep 17 '22 13:09 ovflowd

Can I work on this part?!

b4s36t4 avatar Sep 19 '22 12:09 b4s36t4

Hi, I am interested to work on some of the components and sub-tasks of it.

vickymhs avatar Sep 20 '22 03:09 vickymhs

Hey folks 👋 you can simply work on these issues by just making PRs, no need to ask :)

I still need to update this Issue with the list of components and utilities that need testing, so hold tight, please 🙇

ovflowd avatar Sep 20 '22 23:09 ovflowd

Is anyone working on it? Is this issue still up?

iSatVeerSingh avatar Sep 28 '22 09:09 iSatVeerSingh

The issue is still up. As you can see, no PR was done. I'm still in need of making a complete list of Components that need to be tested.

ovflowd avatar Sep 28 '22 09:09 ovflowd

I would like to help with this issue so I added more unit tests for the SideNavBar component. This is my first time contributing so here's my pull request https://github.com/nodejs/nodejs.dev/pull/2845 for your review.

forgeRW avatar Oct 01 '22 15:10 forgeRW

I'm interested in adding unit tests for the ApiComponents component so here's my PR #2848 for your review.

forgeRW avatar Oct 02 '22 23:10 forgeRW

I would like to contribute to this issue by adding unit tests for DarkModeToggle Component. This is my first time contributing and my PR is https://github.com/nodejs/nodejs.dev/pull/2850.

vickymhs avatar Oct 03 '22 01:10 vickymhs

Hi, I would like to contribute to this issue by adding unit tests for Dropdown component (#2881) and SectionTitle component (#2867). This is my first time contributing. I appreciate your work and waiting for your review.

shlommo avatar Oct 05 '22 09:10 shlommo