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

dive().state() returns null when the component is initiated with shallowWithIntl #36

Open
tridhe opened this issue Oct 15, 2020 · 1 comment

Comments

@tridhe
Copy link

tridhe commented Oct 15, 2020

I am using shallowwithintl to wrap my component.
Then I am calling the function changeState(mockedEvent, mockedEvent2) which is used to set the state.
Then I am console logging the updated state.

const component = shallowWithIntl(<ExampleComponent/>);
const mockedEvent = { currentTarget: { id: 111, value: 111} };
const mockedEvent2 = { key: 111};
component.dive().instance().changeState(mockedEvent, mockedEvent2);
console.log(component.dive().state())

Ideally component.dive().state() should return the state but it is returning null values. The output looks like this:

{  id: null,
    value: null,
    key: null 
 }

Please let me know if I am missing something here.

@tridhe
Copy link
Author

tridhe commented Oct 15, 2020

Similar issues are reported below but no fix given:
#21
#2
#14

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