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

containsMatchingElement #85

Closed
ayrton opened this issue Jun 14, 2016 · 10 comments
Closed

containsMatchingElement #85

ayrton opened this issue Jun 14, 2016 · 10 comments
Labels

Comments

@ayrton
Copy link
Contributor

ayrton commented Jun 14, 2016

We should consider adding loose equals and loose contain assertions, these were recently intro'd in [email protected], specifically in this PR.

@ayrton ayrton added the feature label Jun 14, 2016
@vesln
Copy link
Contributor

vesln commented Jun 15, 2016

sweet.

any suggestions for the dsl? .loose.equal() and .loose.contain() is one option

@LeopoldoFu
Copy link

LeopoldoFu commented Jun 21, 2016

Seems like it is matchesElement and containsMatchingElement now.

So how about .matchesElement() and .containsMatchingElement()?

@ayrton
Copy link
Contributor Author

ayrton commented Jun 22, 2016

From reading the documentation

@lelandrichardson @ljharb what are your thoughts on the loose for the dsl?

@ljharb
Copy link
Member

ljharb commented Jun 22, 2016

It seems like it'd be simplier to do expect(foo).to.matchElement(bar) and expect(foo).to.containMatchingElement(bar).

@benjamine
Copy link

benjamine commented Aug 17, 2016

maybe expect(foo).to.contain.matchingElement(bar) ? (following the dot-notation style of other assertions like have)

@sherwinyu
Copy link

This would be great! If no one is working on it, I may try to take a stab at it this weekend -- came looking for this feature and found this existing issue.

@ayrton
Copy link
Contributor Author

ayrton commented Aug 30, 2016

@sherwinyu feel free to start an implementation, this is def. something we will accept as a PR. I currently like @benjamine's suggestion the most

@Drasky-Vanderhoff
Copy link

I'm new to enzyme and i just found that really want to use containMatchingElement in order to avoid restriction of getting exactly the same tag with all attributes in order to match with the one i expecting. Glad that you are considering this feature, is there any idea of when this will be implemented or someone is actually working on it ? Thanks!

@ayrton
Copy link
Contributor Author

ayrton commented Nov 24, 2016

@Drasky-Vanderhoff no work has been started as far as I know, I also don't have a timeline as to when someone will start working on this

@wKich
Copy link

wKich commented Jun 1, 2018

Hi. Is the matchesElement supported? I don't see implementation in PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants