Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Provide some test examples for react-transmit components #12

Open
zerkalica opened this issue Apr 14, 2015 · 2 comments
Open

Provide some test examples for react-transmit components #12

zerkalica opened this issue Apr 14, 2015 · 2 comments
Assignees

Comments

@zerkalica
Copy link

How to write unit-tests for react transmitted components. mocha+chai or jest. is there a some differences for react or react-transmitted components?. Can i test component without calling fetch method?

@RickWong
Copy link
Owner

How are you testing regular React components right now? Transmit containers are simply React components that either render nothing, or render the wrapped component with additional transmitted props. If you could provide an example test where you're stuck then I could explain it more using that test case.

@zerkalica
Copy link
Author

I create some examples: https://gist.github.com/zerkalica/a1d2842ee0de9132eff7

My questions:
For tests:

  1. Without dom emulation: how to provide fakeQueryParams and reproduce state of UserList without rendering into document (componentWillMount not called)
  2. With dom emulation: Mocking fetch in UserList is right way ?

For app:

  1. How to change UserList state without fetching new users. We don't use setState, only setQueryParams ?
  2. How to do onUserDelete action right way in relay paradigm, without flux actions/stores
  3. Is relay/transmit standalone state-manipulation technology (like flux) or only data-fetching layer ?

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

No branches or pull requests

2 participants