You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to check the value set in to prop for the Layout component.
What is actually happening?
The Page component sets to prop for Layout component, but is not possible to test because wrapper.props() returns {} and wrapper.attributes() returns { to: [Object object] }
Is highly possible that I'm misunderstanding some basic functionality. In that case, how could I test the value of to prop is correctly set from Page?
Thanks
The text was updated successfully, but these errors were encountered:
Aferz
changed the title
Unexpected when composing components and root element is a component
Unexpected behaviour when composing components and root element is a component
Jan 3, 2019
This is different to that issue. The confusing behavior is because props returns the props of the root instance (Page), but attributes returns the attributes of the root DOM element, which is the Layout stub. If you get a wrapper of Layout, by calling find with Layout as a selector, you will get the expected behavior:
Version
1.0.0-beta.28
Reproduction link
https://codesandbox.io/s/lx2r4qv33l
Steps to reproduce
Check the codesandbox. (Console)
What is expected?
I need to check the value set in
to
prop for theLayout
component.What is actually happening?
The
Page
component setsto
prop forLayout
component, but is not possible to test becausewrapper.props()
returns{}
andwrapper.attributes()
returns{ to: [Object object] }
Is highly possible that I'm misunderstanding some basic functionality. In that case, how could I test the value of
to
prop is correctly set fromPage
?Thanks
The text was updated successfully, but these errors were encountered: