vmware-archive / clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.
http://clarity.design
MIT License
6.43k stars 763 forks source link

[Backport] fix(react): fix jsdom react testing issues #6636

Closed ashleyryan closed 2 years ago

ashleyryan commented 2 years ago

Fixes #5985

Fixes #6525:

Signed-off-by: Ashley Ryan asryan@vmware.com

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

Issue #5985 When rendering CdsSelect in jsdom (via react-testing-library), an exception will be thrown on render and all tests will fail.

Issue #6525 The aria-reflect polyfill doesn't run in node because of jsdom exceptions, meaning react unit tests can't target elements by role

What is the new behavior?

Does this PR introduce a breaking change?

Other information