Closed
Description
Describe the Feature
toContainElement
is a Jest DOM matcher asserting that given element contains other passed element.
We also have toContainElement
already implemented in Jest Native. So migrating it to current repo, updating code to use RNTL helpers and reviewing TS types + tests quality should be the scope for the task.
Possible Implementations
Proposed API:
export function toContainElement(
this: jest.MatcherContext,
container: ReactTestInstance,
element: ReactTestInstance | null,
) {
The matcher should:
- Validate that it is invoked on a host element
- Check if given element contains the passed element
Each matcher should have a fairly comprehensive test suite.