Add test for `doesSessionExist` returning false when backend is not reachable
dulowski-marek opened this issue · comments
Marek Dulowski commented
Problem
Currently (supertokens/supertokens-auth-react@1c9f5b3) supertokens-auth-react
relies on doesSessionExist
returning false in SessionAuth
when backend is not reachable.
Goal
Preserve the bevaiour to keep the developer experience good. It should still render the UI when backend is unreachable, because we instruct the user to setup the frontend first.
Solution
Add a unit test:
- Given that backend is not reachable
- When I call
doesSessionExist
- Then it should return
false
and NOT throw an error
Note: doesSessionExist
calls refresh session function underneath, so make sure to test for this case as well.
Prerequisites
This will require unit tests to be set up.