import { type Options } from "https://deno.land/x/fresh_testing_library@0.13.1/deps/testing-library.ts";
Properties
When using userEvent.upload
, automatically discard files
that don't match an accept
property if it exists.
We intend to automatically apply modifier keys for printable characters in the future.
I.e. A
implying {Shift>}a{/Shift}
if caps lock is not active.
This options allows you to opt out of this change in foresight. The feature therefore will not constitute a breaking change.
Between some subsequent inputs like typing a series of characters
the code execution is delayed per setTimeout
for (at least) delay
seconds.
This moves the next changes at least to next macro task
and allows other (asynchronous) code to run between events.
null
prevents setTimeout
from being called.
The document.
This defaults to the owner document of an element if an API is called directly with an element and without setup. Otherwise it falls back to the global document.
An array of keyboard keys the keyboard device consists of.
This allows to plug in different layouts / localizations.
Defaults to a "standard" US-104-QWERTY keyboard.
An array of available pointer keys.
This allows to plug in different pointer devices.
The pointer API includes a check if an element has or inherits pointer-events: none
.
This check is known to be expensive and very expensive when checking deeply nested nodes.
This option determines how often the pointer related APIs perform the check.
This is a binary flag option. You can combine multiple Levels.
userEvent.type
automatically releases any keys still pressed at the end of the call.
This option allows to opt out of this feature.
userEvent.type
implies a click at the end of the element content/value.
This option allows to opt out of this feature.
userEvent.click
implies moving the cursor to the target element first.
This options allows to opt out of this feature.
Write selected data to Clipboard API when a cut
or copy
is triggered.
The Clipboard API is usually not available to test code.
Our setup
replaces the navigator.clipboard
property with a stub.
Defaults to false
when calling the APIs directly.
Defaults to true
when calling the APIs per setup
.