Test Cases: Validation & Input Errors
Module: Edge Cases - Validation
Priority: P2
Phase: 6 (Days 17-18)
Prerequisites
- User logged in with appropriate role for each test
- Access to test data from
00_MASTER_TEST_DATA.md
1. Form Validation - Required Fields
TC-VAL-01: Login Form - Empty Fields
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to /login. | Login form displayed. |
| 2 | Click "Sign In" without entering any data. | Validation errors: "Email is required", "Password is required". |
| 3 | Enter email only, click Sign In. | Validation error: "Password is required". |
| 4 | Enter password only, click Sign In. | Validation error: "Email is required". |
TC-VAL-02: Registration Form - Required Fields
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to /register. | Registration form displayed. |
| 2 | Click "Register" with all fields empty. | Validation errors for all required fields. |
| 3 | Fill partial fields (name only). | Remaining required fields show errors. |
| 4 | Verify each required field shows error when missing. | Name, Email, Password, Confirm Password all required. |
TC-VAL-03: Invoice Creation - Required Fields
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as treasurer@demo.membervu.com. | Dashboard displayed. |
| 2 | Navigate to Admin > Invoices > Create. | Invoice form displayed. |
| 3 | Click "Create" without selecting member. | Error: "Member is required". |
| 4 | Select member but no line items. | Error: "At least one line item required". |
| 5 | Add line item with empty description. | Error: "Description is required". |
TC-VAL-04: Event Creation - Required Fields
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as events@demo.membervu.com. | Dashboard displayed. |
| 2 | Navigate to Admin > Events > Create. | Event wizard Step 1. |
| 3 | Click "Next" without filling title. | Error: "Event title is required". |
| 4 | Enter title, skip description. | Allowed (description optional) or error if required. |
| 5 | Proceed through wizard, skip date. | Error: "Event date is required". |
2. Email Validation
TC-VAL-05: Invalid Email Formats
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to /register. | Form displayed. |
| 2 | Enter email: "notanemail". | Error: "Invalid email format". |
| 3 | Enter email: "missing@domain". | Error: "Invalid email format". |
| 4 | Enter email: "@nodomain.com". | Error: "Invalid email format". |
| 5 | Enter email: "spaces in@email.com". | Error: "Invalid email format". |
| 6 | Enter email: "valid@email.com". | No error, field accepted. |
TC-VAL-06: Email Uniqueness
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to /register. | Form displayed. |
| 2 | Enter existing email: testmember@rcme.membervu.com. | - |
| 3 | Fill remaining fields and submit. | Error: "Email already registered" or "Account exists". |
| 4 | Verify no account created. | Database unchanged. |
3. Password Validation
TC-VAL-07: Password Strength Requirements
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to /register. | Form displayed. |
| 2 | Enter password: "abc". | Error: "Minimum 8 characters". |
| 3 | Enter password: "abcdefgh". | Error: "Must include uppercase letter". |
| 4 | Enter password: "Abcdefgh". | Error: "Must include number". |
| 5 | Enter password: "Abcdefg1". | Error: "Must include special character". |
| 6 | Enter password: "Abcdefg1!". | Password accepted. |
TC-VAL-08: Password Confirmation Mismatch
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to /register. | Form displayed. |
| 2 | Enter password: "ValidPass1!". | - |
| 3 | Enter confirm password: "DifferentPass1!". | Error: "Passwords do not match". |
| 4 | Enter matching confirm password. | No error. |
4. Numeric Field Validation
TC-VAL-09: Payment Amount Validation
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as testmember@rcme.membervu.com. | Dashboard displayed. |
| 2 | Navigate to a pending invoice, click Pay. | Payment form displayed. |
| 3 | Enter amount: 0. | Error: "Amount must be greater than 0". |
| 4 | Enter amount: -100. | Error: "Invalid amount". |
| 5 | Enter amount: "abc". | Error: "Must be a number" or field rejects non-numeric. |
| 6 | Enter amount: 999999999999. | Error or handling for max amount. |
TC-VAL-10: Invoice Line Item Amount
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open invoice creation form. | Form displayed. |
| 2 | Add line item with amount: 0. | Error: "Amount must be greater than 0". |
| 3 | Add line item with amount: -500. | Error: "Invalid amount". |
| 4 | Add line item with amount: "free". | Field rejects or error. |
TC-VAL-11: Event Capacity Validation
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open event creation wizard. | Wizard displayed. |
| 2 | Enter capacity: 0. | Error or warning: "Invalid capacity". |
| 3 | Enter capacity: -10. | Error: "Capacity must be positive". |
| 4 | Enter capacity: 1000000. | Accepted or reasonable limit warning. |
5. Date Validation
TC-VAL-12: Invoice Due Date
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open invoice creation form. | Form displayed. |
| 2 | Set due date: yesterday. | Warning: "Due date is in the past" (may allow). |
| 3 | Set due date: 10 years ago. | Error or strong warning. |
| 4 | Set due date: 10 years in future. | Allowed (no reasonable limit). |
TC-VAL-13: Event Date Validation
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open event creation wizard. | Wizard displayed. |
| 2 | Set start date: past date. | Warning: "Event date is in the past" (may allow for testing). |
| 3 | Set end date before start date. | Error: "End date must be after start date". |
| 4 | Set start time after end time (same day). | Error: "End time must be after start time". |
6. File Upload Validation
TC-VAL-14: Payment Proof File Size
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open payment form with file upload. | Upload field displayed. |
| 2 | Select file > 5MB. | Error: "File too large. Maximum 5MB". |
| 3 | Select file exactly 5MB. | Accepted (boundary). |
| 4 | Select file < 5MB. | Accepted. |
TC-VAL-15: Payment Proof File Type
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open payment form with file upload. | Upload field displayed. |
| 2 | Select .exe file. | Error: "Invalid file type. Allowed: JPG, PNG, PDF". |
| 3 | Select .zip file. | Error: "Invalid file type". |
| 4 | Select .doc file. | Error: "Invalid file type". |
| 5 | Select .jpg file. | Accepted. |
| 6 | Select .png file. | Accepted. |
| 7 | Select .pdf file. | Accepted. |
TC-VAL-16: Avatar Upload Validation
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to profile settings. | Profile form displayed. |
| 2 | Upload avatar > 2MB. | Error: "Avatar too large. Maximum 2MB". |
| 3 | Upload non-image file. | Error: "Invalid file type". |
| 4 | Upload valid JPG/PNG < 2MB. | Accepted, preview shown. |
7. Text Length Validation
TC-VAL-17: Character Limits
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open event creation - title field. | - |
| 2 | Enter 500 characters. | Truncated or error if max exceeded. |
| 3 | Open broadcast - subject field. | - |
| 4 | Enter 150 characters (max ~100). | Truncated or error. |
| 5 | Open invoice note field. | - |
| 6 | Enter very long text (1000+ chars). | Accepted or truncated gracefully. |
TC-VAL-18: Special Characters Handling
| Step | Action | Expected Result |
|---|---|---|
| 1 | Enter name: "O'Connor". | Accepted (apostrophe). |
| 2 | Enter name: "José García". | Accepted (accents). |
| 3 | Enter text: "". | Text escaped/sanitized on display. |
| 4 | Enter text: "Test & Demo". | Ampersand displayed correctly. |
8. Form State Validation
TC-VAL-19: Unsaved Changes Warning
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open any form (invoice, event, profile). | Form displayed. |
| 2 | Make changes but don't save. | Form has unsaved data. |
| 3 | Navigate away (click link or back button). | Warning: "You have unsaved changes". |
| 4 | Cancel navigation. | Stay on form, data preserved. |
| 5 | Confirm navigation. | Navigate away, data lost. |
TC-VAL-20: Submit Button State
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open any form. | Submit button enabled. |
| 2 | Clear a required field. | Submit button may disable or remain enabled. |
| 3 | Click submit with validation errors. | Form not submitted, errors highlighted. |
| 4 | Fix all errors. | Submit button enabled/functional. |
9. Access Without Authentication
TC-VAL-21: Protected Page Access
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open incognito/private browser. | No session. |
| 2 | Navigate to /admin/dashboard. | Redirect to /login. |
| 3 | Navigate to /profile. | Redirect to /login. |
| 4 | Navigate to /invoices. | Redirect to /login. |
| 5 | Navigate to /events (public). | Allowed (public page). |
| 6 | Navigate to /events/e2e-paid-event. | Allowed (public event landing). |
TC-VAL-22: API Access Without Token
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open browser DevTools > Console. | - |
| 2 | Call: fetch('/api/membership/members'). | Status 401 Unauthorized. |
| 3 | Call: fetch('/api/billing/invoices'). | Status 401 Unauthorized. |
| 4 | Call: fetch('/api/events'). | Status 200 (public endpoint) or 401. |
10. Cross-Tenant Data Access
TC-VAL-23: Tenant Isolation
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as admin@rcme.membervu.com (rcme tenant). | Dashboard for rcme. |
| 2 | Note a member ID from this tenant. | e.g., member-uuid-123. |
| 3 | Attempt API: GET /api/membership/members/[other-tenant-member-id]. | 404 or 403 - not found/forbidden. |
| 4 | Attempt to modify invoice from another tenant. | 404 or 403 - operation blocked. |
Summary Checklist
| Category | Test Cases | Priority |
|---|---|---|
| Required Fields | TC-VAL-01 to TC-VAL-04 | P1 |
| Email Validation | TC-VAL-05 to TC-VAL-06 | P1 |
| Password Validation | TC-VAL-07 to TC-VAL-08 | P1 |
| Numeric Validation | TC-VAL-09 to TC-VAL-11 | P1 |
| Date Validation | TC-VAL-12 to TC-VAL-13 | P2 |
| File Upload | TC-VAL-14 to TC-VAL-16 | P1 |
| Text Length | TC-VAL-17 to TC-VAL-18 | P2 |
| Form State | TC-VAL-19 to TC-VAL-20 | P2 |
| Auth Protection | TC-VAL-21 to TC-VAL-22 | P0 |
| Tenant Isolation | TC-VAL-23 | P0 |