user-event
user-event copied to clipboard
Should not be able to type on inert items
Reproduction example
https://github.com/storybookjs/storybook/issues/27138
Prerequisites
<form inert="true">
<input placeholder="not focusable" />
</form>
should not be able to click, focus or write with
await expect(input).toBeEnabled();
await userEvent.type(input, 'can write');
Expected behavior
If an element is inert it should fail to write and fail expects
Actual behavior
nothing happens
User-event version
14.5.2
Environment
Testing Library framework: @testing-library/[email protected]
JS framework: [email protected]
Test environment: [email protected]
DOM implementation: [email protected]
Additional context
https://github.com/storybookjs/storybook/issues/27138
https://github.com/capricorn86/happy-dom/issues/1422
https://github.com/jsdom/jsdom/issues/3605
children of inert element shouldn't be even be ably to queried with get* methods without explicit { hidden: true } option