Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Add tests for Login & SignUp functionality of the Supabase backend#182

Draft
TVW96 wants to merge 6 commits intomainfrom
181-enable-the-login-signup-features-for-live-testing
Draft

Add tests for Login & SignUp functionality of the Supabase backend#182
TVW96 wants to merge 6 commits intomainfrom
181-enable-the-login-signup-features-for-live-testing

Conversation

@TVW96
Copy link
Copy Markdown

@TVW96 TVW96 commented Jun 26, 2025

Summary & Changes 📃

  • Resolves: Add tests for Login & SignUp functionality of the Supabase backend #182

  • Summary: (Briefly describe what this PR does)

    • 🔨 What does this issue fix?
    • With the PR we can test the login and signup functionality for the Shift App. Prior we were not able to successfully sign up for a user account and then login to the previously created account. There was no logic for storing user profiles in the backend of the project. Completing this PR will add: (1) Package dependencies for testing the backend features of the application using the UI components. (2) LoginPage.test.tsx. (3) SignUpPage.test.tsx.
    • 👀 What is the expected behavior?
    • Developers can run test and all test will succeed. Users will be able to signup for app account and login into to that profile accessing the main features of the app.
  • What are the changes made?

    1. Create test files for login and signup page.
    2. Edit RLS policy for profiles table to accept inserts from users with NULL auth.uid().
    3. Remove manual profile tables insertion from signup page utilizing supabase trigger function.
    4. Create proper database typing in getQueries, this included writing a script for automatically loading the database.ts file in @/types. Loading @types/database file run npm run db:types in VScode terminal.

How to Test 🧪

  1. Steps to Reproduce:
    • Step 1: npx jest LoginPage.test.tsx
    • Step 2: npx jest SignUpPage.test.tsx
  2. Expected Behavior: (Describe what should happen)
    Tests are green 🍏
  3. Actual Behavior (if bug): (Describe what happens instead)
    Test will fail 🧯

Checklist ✅

  • I have tested this PR locally and it works as expected.
  • This PR resolves an issue (Resolves #issue-number).
  • Reviewers, assignees(self), tags, and labels are correctly assigned.
  • Squash commits and enable auto-merge if approved.

@TVW96 TVW96 linked an issue Jun 26, 2025 that may be closed by this pull request
2 tasks
@TVW96 TVW96 self-assigned this Jun 26, 2025
@TVW96 TVW96 added bug Something isn't working enhancement New feature or request labels Jun 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write test for Login & Sign Up Feature

1 participant