Session 5: Clinic App - Invite Flow
Date: 2026-06-11 Module: Clinic App - Invite Flow URL: https://practice-stg-new.kulcare.com/account/users Tester: [Your Name]
Test Results Summary
| Category | Tested | ✅ Passed | ❌ Failed |
|---|---|---|---|
| Doctor Invite - Admin | 13 | 11 | 2 |
| Doctor Invite - User | 10 | 10 | 0 |
| Staff Invite - Admin | 11 | 9 | 2 |
| Staff Invite - User | 5 | 5 | 0 |
| SMS/Notification | 3 | 3 | 0 |
| Multi-Clinic Scoping | 4 | 4 | 0 |
| Total | 46 | 42 | 4 |
Detailed Test Results
Doctor Invite - Admin Side (13 Tested)
| # | Test Case | Result | Notes |
|---|---|---|---|
| 1 | Add Doctor - Complete Flow | ✅ Pass | SMS sent, invite appears |
| 2 | Add Doctor - Phone Only | ✅ Pass | Invite created |
| 3 | Add Doctor - With Message | ✅ Pass | Message in SMS |
| 4 | View Pending Invites | ✅ Pass | Shows pending invites |
| 5 | View Invite Details | ✅ Pass | Shows details |
| 6 | Cancel Pending Invite | ✅ Pass | Invite cancelled |
| 7 | Empty First Name | ✅ Pass | Error shown |
| 8 | Empty Last Name | ✅ Pass | Error shown |
| 9 | Empty Phone | ✅ Pass | Error shown |
| 10 | Invalid Phone Format | ✅ Pass | Error shown |
| 11 | Invalid Email Format | ✅ Pass | Error shown |
| 12 | Whitespace-Only Names | ❌ FAIL | Bug #20 |
| 13 | Cancel Non-Pending Invite | ✅ Pass | Error shown |
| 14 | Invite to Non-Owner/Admin | ✅ Pass | Permission error |
Doctor Invite - User Side (10 Tested)
| # | Test Case | Result | Notes |
|---|---|---|---|
| 15 | Accept Invite - New User (Pre-filled) | ✅ Pass | Form pre-filled |
| 16 | Accept Invite - Existing User | ✅ Pass | Role added |
| 17 | View Pending Invites | ✅ Pass | Shows all invites |
| 18 | Decline Invite | ✅ Pass | Status updated |
| 19 | View Invite Details | ✅ Pass | Shows facility info |
| 20 | Expired Invite | ✅ Pass | Error shown |
| 21 | Already Accepted Invite | ✅ Pass | Error shown |
| 22 | Invite for Different User | ✅ Pass | Error shown |
| 23 | Phone Mismatch | ✅ Pass | Error shown |
| 24 | Accept Without Auth | ✅ Pass | Redirect to login |
Staff Invite - Admin Side (11 Tested)
| # | Test Case | Result | Notes |
|---|---|---|---|
| 25 | Add Staff - Complete Flow | ✅ Pass | SMS sent |
| 26 | Add Staff - Role Selection | ✅ Pass | Role assigned |
| 27 | Add Staff - With Message | ✅ Pass | Message in SMS |
| 28 | View Pending Staff Invites | ✅ Pass | Shows pending |
| 29 | Cancel Staff Invite | ✅ Pass | Invite cancelled |
| 30 | Empty Phone | ✅ Pass | Error shown |
| 31 | Empty Staff Role | ✅ Pass | Error shown |
| 32 | Invalid Phone Format | ✅ Pass | Error shown |
| 33 | Invalid Email Format | ✅ Pass | Error shown |
| 34 | Whitespace-Only Names | ❌ FAIL | Bug #20 |
| 35 | Staff Cannot Invite Admin | ✅ Pass | Permission error |
| 36 | Admin Cannot Invite Owner | ✅ Pass | Permission error |
| 37 | Owner Can Invite All Roles | ✅ Pass | All created |
Staff Invite - User Side (5 Tested)
| # | Test Case | Result | Notes |
|---|---|---|---|
| 38 | Accept Staff Invite - New User (Pre-filled) | ✅ Pass | Form pre-filled |
| 39 | Accept Staff Invite - Existing User | ✅ Pass | Role added |
| 40 | Decline Staff Invite | ✅ Pass | Status updated |
| 41 | Expired Staff Invite | ✅ Pass | Error shown |
| 42 | Accept Staff Invite for Different User | ✅ Pass | Error shown |
SMS/Notification (3 Tested)
| # | Test Case | Result | Notes |
|---|---|---|---|
| 43 | SMS Received on Doctor Invite | ✅ Pass | SMS with link |
| 44 | SMS Received on Staff Invite | ✅ Pass | SMS with link |
| 45 | Personal Message in SMS | ✅ Pass | Message included |
Multi-Clinic Invite Scoping (4 Tested) ✅
| # | Test Case | Result | Notes |
|---|---|---|---|
| 46 | Invite from Clinic A → User added ONLY to Clinic A | ✅ Pass | User doesn't access Clinic B or C |
| 47 | Admin with multiple clinics sends invite → Correct clinic scoped | ✅ Pass | Invite scoped to specific facility |
| 48 | User accepts invite → Appears ONLY in that clinic's list | ✅ Pass | Correct clinic association |
| 49 | User cannot see other clinics after accepting invite | ✅ Pass | Proper role-based access |
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 |
| 45 | Role mismatch — registered user only sees invites matching their role | 🟡 High | NEW |
| 46 | Invite role overwritten at signup — always registers as staff | 🟡 High | NEW |
| 47 | Registered user receives signup link instead of accept link | 🟡 High | NEW |
🆕 New Bugs (Re-test 2026-06-17)
Bug #45: Invite Role Mismatch — Registered User Only Sees Matching Role Invites
Description: Admin sends staff invite to a phone already registered as "staff". If admin selects "staff" → invite appears ✅. If any other role → invite does NOT appear ❌. The invite list is role-filtered on the recipient side.
Impact: Admin can't change a staff member's role via invite. Invites silently fail.
Bug #46: Invite Role Overwritten at Signup — Always Registers as Staff
Description: Admin selects "doctor" role for unregistered user invite. User signs up → role always becomes "staff". The selected role is not carried through.
Impact: Admin must manually change roles after every signup. Extra work, confusing.
Bug #47: Registered User Receives Signup Link Instead of Accept Link
Description: Already registered phone receives signup SMS link, not accept/join link. User sees signup form instead of accept flow.
Impact: Confusing UX — registered users see signup instead of accept.
Recommendations
- Fix backend validation error display (Bug #19)
- Add whitespace-only name validation (Bug #20)
- Block invite to existing patients (Bug #21)
- Add cancelled invites visibility (Bug #22)
- Add duplicate email check (Bug #23)
- Block invite to registered email (Bug #24)
- Reset form state on modal close (Bug #25)
- Block invite to active user (Bug #26)
Session Status: ✅ Complete