Closed hitochan777 closed 6 years ago
@bernabe9 I noticed that __setSession
, __setUser
and __setError
modifies the global variables in localforage.js
but you did not initialize them before each test. Maybe we should do so in order to make all the tests independent of the previous tests? Or did you do this intentionally for some reason? Thanks!
Good work 💪
About the global variables in the tests you're right, we should initialize them before each test. So, maybe we could open a new PR later to improve those test.
@bernabe9 thanks for merging my PR! Yeah, definitely. we can work on it together.
Changes
initSessionService
now returns promiserefreshFromLocalStorage
also returns promisesessionService.loadUser().then(...)
to guarantee that user is set to the redux state when the promise returned byinitSessionService
is resolved.beforeAll
in index.spec.js callsdone
when the promise is resolved, instead of subscribing to redux store.