what is "mockAppState"? can you please explain me more?
mockAppState is the mocked redux state that your component needs to be able to run. It should include data for all redux nodes that the component is using.
mockAppState
Take a component like this:
//the redux state looks like this; // { // name: "Fredrik", // title: "Developer" // } import { useSelector } from "react-redux"; const MyComponent = () => { const reduxState = useSelector((state) => state) return (<h1>Hello {reduxState.name}</h1>) }
A mocked app state for the above component would look like this:
{ name: "Mocked name", }
So that you can run tests against a state that you have full control over.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
what is "mockAppState"? can you please explain me more?
mockAppState
is the mocked redux state that your component needs to be able to run.It should include data for all redux nodes that the component is using.
Take a component like this:
A mocked app state for the above component would look like this:
So that you can run tests against a state that you have full control over.