Closed NickColley closed 8 years ago
Needs a review on the tests, the mocking seems a little suspect to me.
So this has tests to check that store.reset
is called during signIn
and signOut
, correct? I'm also not following the hoodie
mock passed into init
.
Out of curiosity why does hoodie.account.id change on signout?
hoodie.account.id
gets set immediately on first page load, even before you sign up for an account. So when you sign out, it’s as if you’d load hoodie for the first time: you get a new user account id. The main reason for this is that we want to allow users to create data even before signing up for an account, and store their user id in createdBy
properties of all objects stored
we mock the hoodie
api for the init
unit test to avoid any side effects, as it’s just a unit test, and ideally you pass in only the bits the respective unit test needs.
hoodie-client
is kinda hard to test, and we still figure out how to do the implementation best, but for now the init
test is better than nothing :)
Looks good to me. :+1:
looks great, thanks @nickcolley
closes #44
Out of curiosity why does hoodie.account.id change on signout?