Basic

  • Testing a basic (email+password) authentication.

Summary

  1. In db-utils, implement the createUser utility, following the steps.
  2. Mention the asyncDispose for clean up of the created user. Handy!
  3. createUser creates a test user. You might've heard that "test users" should be avoided. Talk about the difference between the two (we aren't creating a user that acts and asserts on internals; "test user" simply means an actual user record we created for test purposes).

  1. Create new test at tests/e2e/authentication-basic.test.ts.
  2. Create a new test case for successful authentication using email and password.
  3. In the test, use the newly created createUser() utility, which generates a new user and creates it in the database.
  4. Log in by filling the log in form as the user would.
  5. Assert that the authentication is successful based on the user profile link being visible on the screen.
  6. npm run test:e2e.

  1. Another test case in the same file focused on displaying an error when authentication fails.
  2. Similar steps but no setup so the user doesn't exist.
  3. Assert the error message being shown (correct role and text).
  4. npm run test:e2e.

Please set the playground first

Loading "Basic"
Loading "Basic"

No tests here ๐Ÿ˜ข Sorry.