vmware-clarity / core

Clarity is a scalable, accessible, customizable, open-source design system built with web components. Works with any JavaScript framework, created for enterprises, and designed to be inclusive.
https://clarity.design
MIT License
164 stars 42 forks source link

`CdsButton` and `CdsControlAction` not receiving `keydown` events in tests #218

Open dturcotte opened 1 year ago

dturcotte commented 1 year ago

Describe the bug

onKeyDown is never fired during tests for components CdsControlAction and CdsButton. I first noticed this in CdsControlAction and reproduced it in CdsButton while making the repro, so maybe it's an issue with the base button?

How to reproduce

Here's a repo that reproduces the problem: https://github.com/dturcotte/cds-control-action-keydown (stackblitz/codesandbox are problematic for test only repros)

The test output is in the README for your convenience

Steps to reproduce the behavior:

  1. Clone repo
  2. yarn install
  3. yarn test
  4. See the CdsButton and CdsControlAction tests fail, and the <button> test passes

Expected behavior

onKeyDown should work in tests

Versions

Clarity project:

Clarity version:

Framework:

Framework version: React 18

Device:

Additional notes

astorije commented 1 year ago

(Definitely still a thing re: flag:stale label)