react icon indicating copy to clipboard operation
react copied to clipboard

chore: add className testing util

Open francinelucca opened this issue 1 month ago • 29 comments

Closes https://github.com/github/primer/issues/5255

This pull request adds a reusable test utility to verify that components correctly handle className props and applies it to the components' tests. The main focus is on improving test coverage and consistency for CSS class name behavior.

Changelog

New

  • Added the implementsClassName function to utils/testing.tsx, which provides a standardized way to test that components render both their default and custom className props.
  • Integrated implementsClassName into existing components test suite, ensuring that the components correctly apply both the base and custom class names.
  • Adds CI to enforce the testing util is used in every component test file

Rollout strategy

  • [ ] Patch release
  • [ ] Minor release
  • [ ] Major release; if selected, include a written rollout or migration plan
  • [x] None; if selected, include a brief description as to why Test-only update

Testing & Reviewing

Merge checklist

  • [x] Added/updated tests
  • [ ] Added/updated documentation
  • [ ] Added/updated previews (Storybook)
  • [ ] Changes are SSR compatible
  • [ ] Tested in Chrome
  • [ ] Tested in Firefox
  • [ ] Tested in Safari
  • [ ] Tested in Edge
  • [ ] (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)

francinelucca avatar Nov 22 '25 05:11 francinelucca

⚠️ No Changeset found

Latest commit: 4ff3cee8c2bb26e468a5f58a64eb5f297435a2de

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

changeset-bot[bot] avatar Nov 22 '25 05:11 changeset-bot[bot]

:wave: Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Nov 22 '25 05:11 github-actions[bot]

🟢 ci completed with status success.

primer-integration[bot] avatar Dec 05 '25 22:12 primer-integration[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 08 '25 18:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 08 '25 19:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 09 '25 20:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 09 '25 20:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 09 '25 21:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 09 '25 22:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 01:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 02:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 02:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 02:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 02:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 02:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 04:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 04:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 04:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 05:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 21:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 10 '25 22:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 11 '25 02:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 11 '25 03:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 11 '25 06:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 11 '25 06:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 11 '25 06:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 11 '25 07:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 11 '25 20:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 15 '25 15:12 github-actions[bot]

:wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

github-actions[bot] avatar Dec 17 '25 14:12 github-actions[bot]