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
Hi, so I am having an issue that's a variant of #71 , and I understand that getState returns the same state based on @dmitry-zaets explanation that the library is for testing the actions, but I have the two following files:
HttpClient-test.js
it('Should place cookie in header to be sent if there is one in local storage',()=>{constopts={headers: {}}constcookie='cookie'conststore=mockStore({global: {cookie: cookie}})constclient=newHttpClient(null,store.dispatch)constexpectedOpts={headers: {'X-RSA-COOKIE': cookie}}expect(client.sendRSACookie(opts)).toEqual(expectedOpts)})
and the test is failing because the store.getState().global.cookie is null. How would I be able to test this without attempting to override the getState function?
The text was updated successfully, but these errors were encountered:
You can initialize the state to whatever you want, so there is no need to rewrite or override the getState function. Aside from this, I'm wondering how your code is working with a real Redux store. AFAIK, you should subscribe to state changes and only then you read the state.
Hi, so I am having an issue that's a variant of #71 , and I understand that
getState
returns the same state based on @dmitry-zaets explanation that the library is for testing the actions, but I have the two following files:HttpClient-test.js
HttpClient.js
and the test is failing because the
store.getState().global.cookie
isnull
. How would I be able to test this without attempting to override thegetState
function?The text was updated successfully, but these errors were encountered: