Support Tickets Tests
Dashboard (/business/apps/support)
Section titled “Dashboard (/business/apps/support)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| SUP-001 | Load tickets dashboard | User has support tickets as business owner | 1. Navigate to /business/apps/support. | Tickets listed with subject, status, priority, department, requester info, and last updated date. Stats shown for open and replied counts. | P0 |
| SUP-002 | Filter by status | Tickets in different statuses exist | 1. Set ?status=open. | Only open tickets displayed. | P1 |
| SUP-003 | Filter by priority | Tickets with different priorities exist | 1. Set ?priority=high. | Only high priority tickets displayed. | P1 |
| SUP-004 | Combined status and priority filters | Diverse ticket data | 1. Set ?status=open&priority=high. | Only open, high-priority tickets displayed. | P2 |
| SUP-005 | Empty tickets list | User has no tickets | 1. Navigate to dashboard. | Empty state displayed. Stats show open: 0, replied: 0. | P1 |
| SUP-006 | Tickets ordered by updated_at | Multiple tickets exist | 1. Navigate to dashboard. | Tickets sorted by most recently updated first. | P1 |
| SUP-007 | Requester info displayed | Tickets have associated requesters | 1. Navigate to dashboard. | Each ticket shows requester username, full name, and avatar from the profiles join. | P1 |
| SUP-008 | Department info displayed | Tickets have assigned departments | 1. Navigate to dashboard. | Each ticket shows department name from the departments join. | P1 |
| SUP-009 | Unauthenticated access | Not signed in | 1. Navigate to dashboard without auth. | Returns empty data (tickets: [], stats: null). | P1 |
Ticket Detail (/business/apps/support/[ticketId])
Section titled “Ticket Detail (/business/apps/support/[ticketId])”Viewing
Section titled “Viewing”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| SUP-010 | View ticket detail | Ticket exists for user (owner) | 1. Navigate to /business/apps/support/{ticketId}. | Ticket details displayed: subject, status, priority, department, requester. Message thread shown in chronological order with author profiles (username, full_name, avatar). | P0 |
| SUP-011 | Non-existent ticket returns 404 | None | 1. Navigate to /business/apps/support/{nonexistent-id}. | Returns 404 “Ticket not found”. | P1 |
| SUP-012 | Access ticket not owned by user | Ticket belongs to different owner | 1. Navigate to ticket detail for a ticket where owner_id differs. | Returns 404 (query filters by owner_id, so it appears as not found). | P0 |
| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| SUP-020 | Reply to ticket | Ticket exists | 1. Enter reply content in the text field. 2. Optionally attach a file URL. 3. Submit reply action. | Message created in support_messages table. Ticket status updated to “replied”. Ticket updated_at refreshed. replied: true returned. | P0 |
| SUP-021 | Reply with attachment | Ticket exists | 1. Enter content and provide attachment URL. 2. Submit reply. | Message created with attachment_url populated. | P1 |
| SUP-022 | Reply with empty content | Ticket exists | 1. Submit reply with empty or whitespace-only content. | Returns 400 “Content is required”. No message created. | P0 |
| SUP-023 | Unauthenticated reply | Not signed in | 1. Submit reply without auth. | Returns 401. | P0 |
Status Changes
Section titled “Status Changes”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| SUP-030 | Close ticket | Ticket is open or replied | 1. Submit close action. | Ticket status set to “closed”. updated_at refreshed. closed: true returned. | P0 |
| SUP-031 | Reopen ticket | Ticket is closed | 1. Submit reopen action. | Ticket status set to “open”. updated_at refreshed. reopened: true returned. | P0 |
| SUP-032 | Close already closed ticket | Ticket is closed | 1. Submit close action. | Status remains “closed”. No error (idempotent update). | P2 |
| SUP-033 | Reopen already open ticket | Ticket is open | 1. Submit reopen action. | Status remains “open”. No error (idempotent update). | P2 |
| SUP-034 | Unauthenticated close | Not signed in | 1. Submit close without auth. | Returns 401. | P0 |
| SUP-035 | Unauthenticated reopen | Not signed in | 1. Submit reopen without auth. | Returns 401. | P0 |
Departments (/business/apps/support/departments)
Section titled “Departments (/business/apps/support/departments)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| SUP-040 | List departments | User has departments | 1. Navigate to /business/apps/support/departments. | All departments listed with name, description, and ticket count (from support_tickets aggregate). Create form available. | P0 |
| SUP-041 | Empty departments list | No departments exist | 1. Navigate to departments page. | Empty state displayed. Create form still available. | P1 |
| SUP-042 | Create department | None | 1. Fill department form (name, optional description). 2. Submit create action. | Department created. Success message “Department created!” displayed. Department appears in list. | P0 |
| SUP-043 | Create department with validation errors | None | 1. Submit create with empty name. | Returns 400 with form validation error “Name is required”. | P1 |
| SUP-044 | Create department with long name | None | 1. Submit create with name exceeding 100 characters. | Returns 400 with validation error (max 100 chars). | P2 |
| SUP-045 | Create department with long description | None | 1. Submit create with description exceeding 500 characters. | Returns 400 with validation error (max 500 chars). | P2 |
| SUP-046 | Update department | Department exists | 1. Submit update action with id, name, and description. | Department updated. updated: true returned. | P1 |
| SUP-047 | Update department missing fields | None | 1. Submit update without id or name. | Returns 400 “Missing fields”. | P1 |
| SUP-048 | Delete department | Department exists with no tickets | 1. Submit delete action with department id. | Department deleted. deleted: true returned. | P1 |
| SUP-049 | Delete department with tickets | Department has associated tickets | 1. Submit delete action. | Returns 500 with foreign key constraint error. Department preserved. | P1 |
| SUP-050 | Delete department missing ID | None | 1. Submit delete without id. | Returns 400 “Missing department ID”. | P2 |
| SUP-051 | Unauthenticated department actions | Not signed in | 1. Submit create, update, or delete without auth. | Returns 401. | P0 |
| SUP-052 | Department scoped to owner | User A creates department | 1. User B navigates to departments. | User B does not see User A’s departments (query filters by owner_id). | P0 |