kielbarry / react-ethereum-wallet

4 stars 5 forks source link

Testing: import snapshots for nested stateful components #65

Open kielbarry opened 5 years ago

kielbarry commented 5 years ago

For example, component SecurityIcon is used in many places, and has it's own 2 snapshots to capture both states (based on condition). Snapshotting a component that includes security icon as pure html renders this problematic. Need to import a single snapshot then for the security icon to be included in snapshots for parent component.

kielbarry commented 5 years ago

Just wrap stateful component in ?

kielbarry commented 5 years ago

https://stackoverflow.com/questions/36211739/invariant-violation-could-not-find-store-in-either-the-context-or-props-of-c

export both connected component and named class component

import named component in tags {} for tests