Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

[Feature Request] MockedProvider can pass down props to child component #2482

Merged

Conversation

miachenmtl
Copy link
Contributor

Allow MockedProvider to accept a props object as prop, and to inject the key/values of the props object as props for the child component. This is useful for testing components using enzyme's setProps method, which only runs on the root node.

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • If this was a change that affects the external API used in GitHunt-React, update GitHunt-React and post a link to the PR in the discussion.

@apollo-cla
Copy link

@miachenmtl: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@ghost ghost added the feature New addition or enhancement to existing solutions label Oct 9, 2018
Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @miachenmtl I've changed props to childProps for a bit of extra clarity, but other than that we're all set here. LGTM - thanks!

@hwillson hwillson merged commit c8a9dd3 into apollographql:master Mar 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New addition or enhancement to existing solutions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants