-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix test login (maybe) #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through the troubleshooting options, I wasn't able to get yarn test
to work even when deleting and reinstalling node_modules
as well as appending a -c
when running it. The solution I found that worked was just using yarn start
and creating an account. Although with this, I found there was already an account made using my ONID. To reset my password, I navigated to firebase project, went to authentication, found my email and utilized the reset password email functionality.
I believe Jeff's changes look good for preventing persistent login but was unable to fully test as I kept running into the initial issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine
Test Login Button Version (backup option, not in latest commit of this PR)EDIT: this commit is outdated, but you can run it with === original comment below Just run the app with I couldn't keep fake user logged in after reloading or restarting the app with this version (no persistent storage), as I was trying to avoid relying on custom environmental files (e.g. Note that this also means that if you log in as real user first, then you need to log out again before you can use the test user version (the real user persists and the test user does not). An alternative approach could be to just have the developers (us) edit the a flag in the default |
Final Version? (yarn test without error)This is the final version for latest commit of this PR.
TestingRun the following in terminal
Check my log file below in case I made a mistake in my instructions above Explanation / Research (summary)Git Branch differences
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sick. I have tested this on my machine and it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code makes sense for the changes that were made and when testing yarn test -c
I was able to get into the app! Great work tracking down this strange bug Jeff!
Issue
Original Error (running
yarn test
)In addition to the above error:
yarn start
), didn't log out afterwards, then ran the app again asyarn test
, then it tries to log you in as a regular user again instead of test user (due to persistent login code conflicting with the test user code)Changes (still applicable to latest commit of this PR)
Tweaked auth logic to prevent persisting the regular user login if running in test mode (
yarn test
).Other changes to drill input is just what happened from running
yarn pretty
Troubleshooting
node_modules
folder (and regenerate them withyarn
) may also help with preventing the error, not sure (regardless, the changed code should still be useful so that the test user works without having to log out the real user first).yarn start
and logging out of regular useryarn start -c
oryarn test -c
(suggested by Frank)Other potential features