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

ShallowWrapper.setProps does not pass old context #119

Closed
srph opened this issue Jan 14, 2016 · 0 comments
Closed

ShallowWrapper.setProps does not pass old context #119

srph opened this issue Jan 14, 2016 · 0 comments

Comments

@srph
Copy link
Contributor

srph commented Jan 14, 2016

Behavior

ShallowWrapper.setProps does not pass the old context to the new shallow-rendered component.

Reproducing

// 1. Use `shallow` as you would (pass `options.context`)
const wrapper = shallow(<MyComponent />, { context: 'yolo' });
// 2. Run an assertion
expect(wrapper.first('div').text()).to.equal('yolo');
// 3. Run `setProps`
wrapper.setProps(5);
// 4. Run the same assertion
expect(wrapper.first('div').text()).to.equal('yolo');

Demo

@srph srph changed the title setProps turns context to undefined ShallowWrapper.setProps turns context to undefined Jan 15, 2016
@srph srph changed the title ShallowWrapper.setProps turns context to undefined ShallowWrapper.setProps does not pass old context Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant