Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: implement toContainElement Jest matcher #1486

Closed
mdjastrzebski opened this issue Sep 4, 2023 · 2 comments
Closed

feature: implement toContainElement Jest matcher #1486

mdjastrzebski opened this issue Sep 4, 2023 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mdjastrzebski
Copy link
Member

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:

  1. Validate that it is invoked on a host element
  2. Check if given element contains the passed element

Each matcher should have a fairly comprehensive test suite.

Related Issues

#1454

@mdjastrzebski mdjastrzebski added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 4, 2023
@mdjastrzebski
Copy link
Member Author

Resolved by #1495

@mdjastrzebski
Copy link
Member Author

🎉 Release in version: v12.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant