hoodiehq / hoodie-account-client

:dog: Account client API for the browser
https://hoodiehq.github.io/hoodie-account-client
Apache License 2.0
11 stars 24 forks source link

Unset `session.invalid` after fetching account from remote #149

Closed mbad0la closed 7 years ago

mbad0la commented 7 years ago

Fixes #146

Notify : @gr2m

gr2m commented 7 years ago

@mbad0la Could you please add tests for the change?

mbad0la commented 7 years ago

@gr2m , how can I test whether the reauthenticate event has been emitted? Will I have to put up a listener on one of the test cases pertaining to reauthenticating a user having an invalid session?

gr2m commented 7 years ago

I think unit tests will be good enough here. You can add them to test/unit/get-test.js and test/unit/get-profile-test.js. You will need to stub state.emitter.emit like you see it in few of the other tests, and then check if it was called with reauthenticate. Also check that cachedProperties.session.invalid has been removed.

mbad0la commented 7 years ago

@gr2m

Ready for review!

mbad0la commented 7 years ago

@gr2m please review!