Open mvasin opened 4 years ago
@mvasin you are absolutely right.
It seems like what is proper would be the following breaking changes:
toContainReact
-> toContainElement
toContainMatchingElement
-> toContainElementBySelector
toContainMatchingElements
-> toContainElementsBySelector
toContainExactlyOneMatchingElement
-> toContainExactlyOneElementBySelector
toMatchElement
and toMatchSelector
already have the right syntax and it should be standardized. Would you be willing to make these changes for us?
It's great to see your support! I'll be happy to do it.
Thanks @mvasin! Of course. I've felt weird about some of these APIs but hadn't given it much thought lately.
toContainReact
looks like an irrelevant name to me.An instance of a component
<MyComponent />
(as opposed to the component itselffunction MyComponent() {}
) according to React core team blog should be called Element. So the name could betoContainElement
, but there is alreadytoContainMatchingElement
, so it will look confusing.Anyway,
toContainReact
doesn't look like an appropriate name, let's come up with a better one. MaybetoContainComponentInstance
.