enzymejs/enzyme

React Elements returned by enzyme in v3 are missing context

Open

#1.344 aberto em 10 de nov. de 2017

Ver no GitHub
 (3 comments) (1 reaction) (0 assignees)JavaScript (2.016 forks)batch import
API: shallowhelp wantedv3 bugs

Métricas do repositório

Stars
 (19.979 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

In v2, if you wanted to get the underlying element, it contained the element's context. In v3, there is no context.

I believe for shallow, we just need to add it here https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js#L224

For mount, it's a few places (in those toTree functions).

I think it'd be nice to have the context on the element though so that it's closer to the real element.

Thoughts?

Guia do colaborador