Invoicing Tests
Dashboard (/business/apps/invoicing)
Section titled “Dashboard (/business/apps/invoicing)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-001 | Dashboard loads stats and recent invoices | User has at least one invoice | 1. Navigate to /business/apps/invoicing. | Dashboard displays stats (total revenue, outstanding, paid, overdue counts). Recent invoices list shows up to 5 items. | P0 |
| INV-002 | Dashboard shows empty state | User has no invoices | 1. Navigate to /business/apps/invoicing. | Stats show zero values. Empty state message or CTA to create first invoice is displayed. | P1 |
| INV-003 | Unauthenticated user sees null state | User is not signed in | 1. Navigate to /business/apps/invoicing without auth. | Page returns stats: null and recentInvoices: []. No error thrown. | P1 |
Invoices List (/business/apps/invoicing/invoices)
Section titled “Invoices List (/business/apps/invoicing/invoices)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-010 | List all invoices | User has multiple invoices | 1. Navigate to /business/apps/invoicing/invoices. | All invoices are displayed with status, customer name, amount, and date. | P0 |
| INV-011 | Filter by status | User has invoices in different statuses | 1. Navigate to invoices list. 2. Select “Paid” from status filter. | Only paid invoices are shown. URL updates with ?status=paid. | P1 |
| INV-012 | Filter by customer | User has invoices for multiple customers | 1. Navigate to invoices list. 2. Select a customer from dropdown. | Only invoices for that customer are shown. URL updates with ?customer={id}. | P1 |
| INV-013 | Filter by date range | User has invoices across date ranges | 1. Set from and to date parameters. | Only invoices within the date range are shown. | P1 |
| INV-014 | Search invoices | User has invoices | 1. Enter a search term in the search field. | Invoices matching the search term (number, customer name) are shown. | P1 |
| INV-015 | Combined filters | User has diverse invoice data | 1. Apply status filter, customer filter, and date range simultaneously. | Results reflect all active filters. Clearing one filter updates results accordingly. | P2 |
Create Invoice (/business/apps/invoicing/invoices/new)
Section titled “Create Invoice (/business/apps/invoicing/invoices/new)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-020 | Create invoice with valid data | At least one customer and catalog item exist | 1. Navigate to /business/apps/invoicing/invoices/new. 2. Select customer. 3. Add line items from catalog. 4. Set date and due date. 5. Submit the create action. | Invoice is created. User is redirected to /business/apps/invoicing/invoices/{id}. | P0 |
| INV-021 | Create invoice with new inline customer | No customers exist | 1. Navigate to create invoice page. 2. Click “Add Customer” inline. 3. Fill name, email. 4. Submit create-customer action. | Customer is created. Customer ID is returned in the form message. Customer appears in the dropdown. | P0 |
| INV-022 | Create invoice with new inline catalog item | No catalog items exist | 1. Navigate to create invoice page. 2. Click “Add Item” inline. 3. Fill name, price. 4. Submit create-catalog-item action. | Catalog item is created. Item ID is returned. Item appears in the line items list. | P1 |
| INV-023 | Missing invoice_data rejected | None | 1. Submit the create action without the invoice_data form field. | Returns 400 with message “Missing invoice data”. | P1 |
| INV-024 | Invalid JSON in invoice_data rejected | None | 1. Submit the create action with malformed JSON in invoice_data. | Returns 400 with a parse error message. | P1 |
| INV-025 | Schema validation failure | None | 1. Submit create with JSON that fails createInvoiceSchema validation (e.g., missing required fields). | Returns 400 with the schema validation error message. | P1 |
| INV-026 | Tax rates loaded on create page | User has tax rates configured | 1. Navigate to create invoice page. | Tax rates are available in the form for selection. | P1 |
| INV-027 | Unauthenticated create rejected | User is not signed in | 1. Submit create action without auth. | Returns 401 “Not authenticated”. | P0 |
Invoice Detail (/business/apps/invoicing/invoices/[id])
Section titled “Invoice Detail (/business/apps/invoicing/invoices/[id])”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-030 | View invoice detail | Invoice exists for user | 1. Navigate to /business/apps/invoicing/invoices/{id}. | Invoice details are displayed: customer, line items, subtotal, tax, total, status, dates. Payment form is available. | P0 |
| INV-031 | Send invoice | Invoice exists in draft status | 1. Navigate to invoice detail. 2. Click “Send” (submit send action). | Invoice is sent. sent: true returned. Invoice status updates to “sent”. | P0 |
| INV-032 | Delete invoice | Invoice exists | 1. Navigate to invoice detail. 2. Click “Delete” (submit delete action). 3. Confirm deletion. | Invoice is deleted. User is redirected to /business/apps/invoicing/invoices. | P0 |
| INV-033 | Duplicate invoice | Invoice exists | 1. Navigate to invoice detail. 2. Click “Duplicate” (submit duplicate action). | A new invoice is created as a copy. User is redirected to the new invoice detail page. | P1 |
| INV-034 | Record payment | Invoice has an outstanding balance | 1. Navigate to invoice detail. 2. Fill payment amount and method in the payment form. 3. Submit record-payment action. | Payment is recorded. Success message “Payment recorded!” displayed. Invoice balance updates. | P0 |
| INV-035 | Record payment with invalid data | Invoice exists | 1. Submit record-payment with invalid form data (e.g., negative amount). | Returns 400 with form validation errors. No payment recorded. | P1 |
| INV-036 | Access another user’s invoice | Invoice belongs to a different user | 1. Navigate to /business/apps/invoicing/invoices/{other-user-id}. | Returns 403 Forbidden. Invoice data is not exposed. | P0 |
| INV-037 | Non-existent invoice returns 404 | None | 1. Navigate to /business/apps/invoicing/invoices/{nonexistent-id}. | Returns 404 “Invoice not found”. | P1 |
Edit Invoice (/business/apps/invoicing/invoices/[id]/edit)
Section titled “Edit Invoice (/business/apps/invoicing/invoices/[id]/edit)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-040 | Load edit form with existing data | Invoice exists for user | 1. Navigate to /business/apps/invoicing/invoices/{id}/edit. | Form is pre-populated with invoice data. Customers, catalog items, and tax rates are loaded. | P0 |
| INV-041 | Update invoice | Invoice exists | 1. Modify customer, date, due date, note, or shipping. 2. Submit update action. | Invoice is updated. User is redirected to invoice detail page. | P0 |
| INV-042 | Create customer inline during edit | None | 1. On edit page, submit create-customer action with valid data. | Customer is created. Customer ID is returned for selection. | P1 |
| INV-043 | Update with missing data rejected | None | 1. Submit update action without invoice_data field. | Returns 400 “Missing data”. | P1 |
| INV-044 | Access control on edit page | Invoice belongs to another user | 1. Navigate to edit page for another user’s invoice. | Returns 403. | P0 |
Customers (/business/apps/invoicing/customers)
Section titled “Customers (/business/apps/invoicing/customers)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-050 | List customers | User has customers | 1. Navigate to /business/apps/invoicing/customers. | All customers are displayed. | P0 |
| INV-051 | Search customers | User has multiple customers | 1. Enter search term in search field. | Filtered customer list is displayed. | P1 |
| INV-052 | Create customer | None | 1. Fill customer form (name, email, company, address fields). 2. Submit create action. | Customer is created. Success message “Customer created!” displayed. Customer appears in list. | P0 |
| INV-053 | Create customer with validation errors | None | 1. Submit create with empty required fields. | Returns 400 with form validation errors. | P1 |
Customer Detail (/business/apps/invoicing/customers/[id])
Section titled “Customer Detail (/business/apps/invoicing/customers/[id])”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-060 | View customer detail | Customer exists | 1. Navigate to /business/apps/invoicing/customers/{id}. | Customer details displayed. Associated invoices listed. Edit form pre-populated. | P0 |
| INV-061 | Update customer | Customer exists | 1. Modify customer fields. 2. Submit update action. | Customer updated. Success message “Customer updated!” displayed. | P1 |
| INV-062 | Delete customer | Customer exists with no linked invoices | 1. Submit delete action. | Customer is deleted. deleted: true returned. | P1 |
| INV-063 | Delete customer with linked invoices | Customer has associated invoices | 1. Submit delete action. | Returns 400 with “Cannot delete” message. Customer is not deleted. | P1 |
| INV-064 | Non-existent customer returns 404 | None | 1. Navigate to /business/apps/invoicing/customers/{nonexistent-id}. | Returns 404 “Customer not found”. | P1 |
Catalog (/business/apps/invoicing/catalog)
Section titled “Catalog (/business/apps/invoicing/catalog)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-070 | List catalog items | User has catalog items | 1. Navigate to /business/apps/invoicing/catalog. | All catalog items displayed with name and price. | P0 |
| INV-071 | Create catalog item | None | 1. Fill item form (name, description, price). 2. Submit create action. | Item created. Success message “Item added!” displayed. | P0 |
| INV-072 | Create catalog item with invalid data | None | 1. Submit create with empty name or invalid price. | Returns 400 with validation errors. | P1 |
| INV-073 | Delete catalog item | Item exists | 1. Submit delete action with item id. | Item deleted. deleted: true returned. | P1 |
| INV-074 | Delete catalog item in use | Item referenced by an invoice line item | 1. Submit delete action. | Returns 400 “Cannot delete” or item is deleted depending on cascade rules. Verify behavior matches spec. | P2 |
Payments (/business/apps/invoicing/payments)
Section titled “Payments (/business/apps/invoicing/payments)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-080 | List payments | User has recorded payments | 1. Navigate to /business/apps/invoicing/payments. | All payments displayed with amount, date, invoice reference, and method. | P0 |
| INV-081 | Empty payments list | User has no payments | 1. Navigate to payments page. | Empty state displayed. No errors. | P1 |
Quotations (/business/apps/invoicing/quotations)
Section titled “Quotations (/business/apps/invoicing/quotations)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-090 | List quotations | User has quotations | 1. Navigate to /business/apps/invoicing/quotations. | All quotations displayed. | P0 |
| INV-091 | Empty quotations list | No quotations exist | 1. Navigate to quotations page. | Empty state displayed. | P1 |
Create Quotation (/business/apps/invoicing/quotations/new)
Section titled “Create Quotation (/business/apps/invoicing/quotations/new)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-100 | Create quotation with valid data | At least one customer exists | 1. Navigate to /business/apps/invoicing/quotations/new. 2. Select customer. 3. Add line items. 4. Submit create action. | Quotation created. User is redirected to /business/apps/invoicing/quotations. | P0 |
| INV-101 | Create quotation with inline customer | None | 1. Submit create-customer action on quotation creation page. | Customer created. ID returned for selection. | P1 |
| INV-102 | Create quotation with inline catalog item | None | 1. Submit create-catalog-item action on quotation creation page. | Item created. ID returned for use. | P1 |
| INV-103 | Missing quotation data rejected | None | 1. Submit create without quotation_data field. | Returns 400 “Missing data”. | P1 |
| INV-104 | Invalid quotation data rejected | None | 1. Submit create with malformed JSON. | Returns 500 with error message. | P1 |
Settings (/business/apps/invoicing/settings)
Section titled “Settings (/business/apps/invoicing/settings)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| INV-110 | Load settings | User has settings configured | 1. Navigate to /business/apps/invoicing/settings. | Settings form pre-populated with current values. Tax rates listed. | P0 |
| INV-111 | Update settings | None | 1. Modify settings (company info, default note, numbering). 2. Submit update-settings action. | Settings saved. Success message “Settings saved!” displayed. | P0 |
| INV-112 | Update settings with invalid data | None | 1. Submit update-settings with invalid form data. | Returns 400 with validation errors. | P1 |
| INV-113 | Create tax rate | None | 1. Fill tax rate form (name, percentage). 2. Submit create-tax action. | Tax rate created. Success message “Tax rate added!” displayed. | P1 |
| INV-114 | Create tax rate with invalid data | None | 1. Submit create-tax with empty name or invalid percentage. | Returns 400 with validation errors. | P1 |
| INV-115 | Delete tax rate | Tax rate exists | 1. Submit delete-tax action with tax rate id. | Tax rate deleted. taxDeleted: true returned. | P1 |
| INV-116 | First-time settings load | No settings exist yet | 1. Navigate to settings as new user. | Page loads gracefully with empty/default form. No errors. | P2 |