Behavior: No database information is retained in between every npm start because App.jsinitialize()method calls clearTables(), so all the data in the database is cleared. We would expect that information in the database to be retained. For example, a user who already created an account should be able to log in even after the server restarts, how ever they have to create an account again.
Steps to Reproduce:
npm start from the root to concurrently start the server and app, navigate to http://localhost:5173/
create an account - if successful, it brings you to home page
quit the server and app by doing command + C on terminal
npm start from the root to concurrently start the server and app, navigate to http://localhost:5173/
tries to log in with the same credentials
log in fails
Device: MacBook Air; OS: MacOS; Browser: Chrome
This issue persists since the code is like this during development - to be clearing tables everytime. It is simple to fix by simply not clearing tables upon initilization in App.js. However, the trouble arises when the test suite is run. Since the test suite operates on the same tables as the ones users will use, the tests will clear user data. We will have to create separate tables just for tests and fix up the SQL queries in the backend code before final release.
npm start
becauseApp.js
initialize()
method callsclearTables()
, so all the data in the database is cleared. We would expect that information in the database to be retained. For example, a user who already created an account should be able to log in even after the server restarts, how ever they have to create an account again.App.js
. However, the trouble arises when the test suite is run. Since the test suite operates on the same tables as the ones users will use, the tests will clear user data. We will have to create separate tables just for tests and fix up the SQL queries in the backend code before final release.