Test plansClinic app
Test Plan: Clinic App - Invite Flow
Module: Clinic App - Invite Flow URL: https://practice-stg-new.kulcare.com/account/users Status: ✅ Complete (Tested 2026-06-11)
Test Data Requirements
| Type | Data | Purpose |
|---|---|---|
| Doctor A | New phone, valid email | Test invite creation |
| Staff A | New phone, valid email | Test staff invite |
| Admin User | Owner/Admin role | Test permission checks |
| Regular User | Staff/Doctor role | Test permission restrictions |
Test Cases
Doctor Invite - Admin Side
| # | Test Case | Priority | Steps | Expected | Result |
|---|---|---|---|---|---|
| 1 | Add Doctor - Complete Flow | P0 | Fill form → Send | SMS sent, invite appears | ✅ Pass |
| 2 | Add Doctor - Phone Only | P0 | Enter phone → Send | Invite created | ✅ Pass |
| 3 | Add Doctor - With Message | P0 | Add personal message → Send | Message in SMS | ✅ Pass |
| 4 | View Pending Invites | P0 | Go to invites list | Pending shown | ✅ Pass |
| 5 | View Invite Details | P0 | Click on invite | Shows details | ✅ Pass |
| 6 | Cancel Pending Invite | P0 | Cancel → Confirm | Invite cancelled | ✅ Pass |
| 7 | Empty First Name | P0 | Leave blank → Send | Error shown | ✅ Pass |
| 8 | Empty Last Name | P0 | Leave blank → Send | Error shown | ✅ Pass |
| 9 | Empty Phone | P0 | Leave blank → Send | Error shown | ✅ Pass |
| 10 | Invalid Phone Format | P0 | Enter letters | Error shown | ✅ Pass |
| 11 | Invalid Email Format | P0 | Enter invalid@ | Error shown | ✅ Pass |
| 12 | Whitespace-Only Names | P1 | Enter " " | Should reject | ❌ FAIL |
| 13 | Cancel Non-Pending Invite | P1 | Try to cancel accepted | Error shown | ✅ Pass |
| 14 | Invite to Non-Owner/Admin | P1 | Staff tries to invite admin | Permission error | ✅ Pass |
Doctor Invite - User Side
| # | Test Case | Priority | Steps | Expected | Result |
|---|---|---|---|---|---|
| 15 | Accept - New User (Pre-filled) | P0 | Open link → Accept | Form pre-filled | ✅ Pass |
| 16 | Accept - Existing User | P0 | Open link → Accept | Role added | ✅ Pass |
| 17 | View Pending Invites | P0 | Go to invites | Shows all | ✅ Pass |
| 18 | Decline Invite | P0 | Decline → Confirm | Status updated | ✅ Pass |
| 19 | View Invite Details | P0 | Click invite | Shows facility | ✅ Pass |
| 20 | Expired Invite | P1 | Open expired link | Error shown | ✅ Pass |
| 21 | Already Accepted Invite | P1 | Open already accepted | Error shown | ✅ Pass |
| 22 | Invite for Different User | P1 | Phone mismatch | Error shown | ✅ Pass |
| 23 | Phone Mismatch | P1 | Different phone | Error shown | ✅ Pass |
| 24 | Accept Without Auth | P1 | Try without logging in | Redirect to login | ✅ Pass |
Staff Invite - Admin Side
| # | Test Case | Priority | Steps | Expected | Result |
|---|---|---|---|---|---|
| 25 | Add Staff - Complete Flow | P0 | Fill form → Send | SMS sent | ✅ Pass |
| 26 | Add Staff - Role Selection | P0 | Select role → Send | Role assigned | ✅ Pass |
| 27 | Add Staff - With Message | P0 | Add message → Send | Message in SMS | ✅ Pass |
| 28 | View Pending Staff Invites | P0 | Go to staff invites | Shows pending | ✅ Pass |
| 29 | Cancel Staff Invite | P0 | Cancel → Confirm | Invite cancelled | ✅ Pass |
| 30 | Empty Phone | P0 | Leave blank → Send | Error shown | ✅ Pass |
| 31 | Empty Staff Role | P0 | Leave blank → Send | Error shown | ✅ Pass |
| 32 | Invalid Phone Format | P0 | Enter letters | Error shown | ✅ Pass |
| 33 | Invalid Email Format | P0 | Enter invalid@ | Error shown | ✅ Pass |
| 34 | Whitespace-Only Names | P1 | Enter " " | Should reject | ❌ FAIL |
| 35 | Staff Cannot Invite Admin | P0 | Staff tries to invite admin | Permission error | ✅ Pass |
| 36 | Admin Cannot Invite Owner | P0 | Admin tries to invite owner | Permission error | ✅ Pass |
| 37 | Owner Can Invite All Roles | P0 | Owner invites any role | All created | ✅ Pass |
Staff Invite - User Side
| # | Test Case | Priority | Steps | Expected | Result |
|---|---|---|---|---|---|
| 38 | Accept Staff - New User (Pre-filled) | P0 | Open link → Accept | Form pre-filled | ✅ Pass |
| 39 | Accept Staff - Existing User | P0 | Open link → Accept | Role added | ✅ Pass |
| 40 | Decline Staff Invite | P0 | Decline → Confirm | Status updated | ✅ Pass |
| 41 | Expired Staff Invite | P1 | Open expired link | Error shown | ✅ Pass |
| 42 | Accept Staff for Different User | P1 | Try to accept as different user | Error shown | ✅ Pass |
SMS/Notification
| # | Test Case | Priority | Steps | Expected | Result |
|---|---|---|---|---|---|
| 43 | SMS on Doctor Invite | P0 | Send doctor invite | SMS received | ✅ Pass |
| 44 | SMS on Staff Invite | P0 | Send staff invite | SMS received | ✅ Pass |
| 45 | Personal Message in SMS | P1 | Add message → Send | Message in SMS | ✅ Pass |
Multi-Clinic Invite Scoping
| # | Test Case | Priority | Steps | Expected | Result |
|---|---|---|---|---|---|
| 46 | Invite from Clinic A | P0 | Invite from Clinic A | User added ONLY to Clinic A | ✅ Pass |
| 47 | Admin with multiple clinics | P0 | Invite from specific clinic | Correct clinic scoped | ✅ Pass |
| 48 | User accepts invite | P0 | Accept invite | Appears ONLY in that clinic | ✅ Pass |
| 49 | User cannot see other clinics | P0 | Accept → Check clinics | Other clinics not visible | ✅ Pass |
Bugs Found
| Bug # | Description | Severity | Status |
|---|---|---|---|
| 18 | Active practitioner API missing phone number | 🟠 Medium | Open |
| 19 | Backend validation error not displayed properly | 🟡 High | Open |
| 20 | Whitespace-only first/last name allowed | 🟠 Medium | Open |
| 21 | Practitioner invite sent to existing patient | 🟡 High | Open |
| 22 | Cancelled invites not visible in admin UI | 🟠 Medium | Open |
| 23 | Duplicate invite with same email in same clinic | 🟠 Medium | Open |
| 24 | Invite sent to registered email | 🔴 Critical | Open |
| 25 | Invite modal form state not reset | 🟠 Medium | Open |
| 26 | Invite to active user | 🔴 Critical | Open |
Test Execution Checklist
- TC-1 to TC-49
Test Plan Status: ✅ Complete
Tested: 2026-06-11
Session File: ../test-reports/sessions/05-clinic-app-invite-flow.md