Fire an event in act
wrapper
a key of the fireEvents
parameter
Optional
options: {}optional, an event object
if fireEvents
is not provided
const render = create(Component, defaultProps, {
queries: {
button: {
query: AccessorQueryType.Text,
parameters: ["Click me"],
},
},
fireEvents: {
buttonClick: ["button", "click"],
},
});
const engine = render({});
engine.fireEvent("buttonClick");
Result of render
of @testing-library/react
Run scenario by key, see scenarios
property of options
key of scenarios
option
Rest
...args: RunScenatioParameters<Scenarios[Key][1]>scenario arguments
An object whose keys are keys of wrappers
from options, and values are results of wrappers
A rough example:
const AwesomeContext = createContext(0);
const render = create(Component, defaultProps, {
queries: {},
wrappers: {
awesome: (children, initialValue) => {
let value = initialValue;
const getActualValue = () => value;
return [
<AwesomeContext.Provider value={value}>
{children}
</AwesomeContext.Provider>,
getActualValue,
];
},
},
wrapperDefaultParams: {
awesome: 0,
},
});
const engine = render({}, {
wrapperParams: {
awesome: 3,
},
});
const awesomeValue = engine.wrappers.awesome();
See an example https://github.com/vtaits/react-integration-test-engine/blob/main/packages/react-integration-test-engine/src/tests/wrappers.test.tsx
Generated using TypeDoc
An object whose keys are keys of the
queries
parameter and whose values are accessors (seeAccessorsType
)