Admin Test Suite

Comprehensive testing for Invoice SaaS system functionality

Test Overview

38
Total Tests
0
Passed
0.0%
0
Failed
0
Running
38
Pending
Test Progress0/38 completed

AI Invoice Parsing

Test OpenAI integration and invoice parsing accuracy

English Input Parsing

Tests AI parsing of simple English invoice requests

Expected: Should extract recipient, items, and amounts from English text

Cantonese Input Parsing

Tests AI parsing of Cantonese invoice requests

Expected: Should extract recipient, items, and amounts from Cantonese text

Mixed Language Parsing

Tests AI parsing of mixed English/Chinese text

Expected: Should handle mixed language content and extract data correctly

Complex Multi-Item Invoice

Tests AI parsing of complex invoices with multiple items and calculations

Expected: Should extract multiple items, quantities, rates, and terms

Currency Normalization

Tests AI parsing that normalizes different currency mentions to company default

Expected: Should normalize mixed currency mentions to company default currency

Edge Cases & Error Handling

Tests AI parsing with invalid inputs and edge cases

Expected: Should handle errors gracefully and provide meaningful feedback

Invoice Generation

Compare AI vs Manual invoice creation

AI vs Manual: Simple Invoice

Compares AI-generated invoice with manually created equivalent

Expected: AI and manual invoices should have matching data and amounts

AI vs Manual: Complex Invoice

Compares AI parsing of complex multi-item invoices with manual creation

Expected: Should accurately parse hourly rates, quantities, and totals

Amount Calculation Accuracy

Tests mathematical accuracy of invoice amount calculations

Expected: Should correctly calculate subtotals, taxes, and final amounts

Currency Consistency

Tests that invoices maintain consistent currency per company settings

Expected: Should use company default currency and handle foreign currency mentions appropriately

Tax Calculation

Tests tax calculation and application in invoices

Expected: Should parse tax percentages and calculate tax amounts correctly

Invoice Number Generation

Tests automatic invoice number generation and formatting

Expected: Should generate unique, sequential invoice numbers in correct format

PDF Template Testing

Test PDF templates grouped by language and company defaults

Company Default Template Usage

Tests that company default template is properly used

Expected: Should use company default template setting for all automated generation

AI Generation Uses Default Template

Tests that AI-generated invoices always use company default template

Expected: AI-generated invoices should automatically use company default template

English - Classic Template

Tests PDF generation with English Classic template

Expected: Should generate professional English PDF with classic styling

English - Modern Template

Tests PDF generation with English Modern template

Expected: Should generate clean modern English PDF

Chinese (HK) - Classic Template

Tests PDF generation with Traditional Chinese Hong Kong classic template

Expected: Should generate properly formatted Traditional Chinese PDF with HK styling

Chinese (HK) - Modern Template

Tests PDF generation with Traditional Chinese Hong Kong modern template

Expected: Should generate clean modern Traditional Chinese PDF

Real-time Preview vs PDF Consistency

Tests that manual input real-time preview matches generated PDF 100%

Expected: Real-time HTML preview should be identical to final PDF output

Template Language Grouping

Tests that templates are properly grouped and selected by language

Expected: Should show appropriate template options based on company locale/language settings

API Endpoints

Test all REST API endpoints

Companies CRUD Operations

Tests Create, Read, Update, Delete operations for companies

Expected: Should successfully create, read, update, and delete company records

Invoices CRUD Operations

Tests Create, Read, Update, Delete operations for invoices

Expected: Should successfully manage invoice lifecycle operations

Invoice Generation API

Tests AI-powered invoice generation endpoint

Expected: Should generate invoices from text input via API

PDF Generation API

Tests PDF generation API endpoint functionality

Expected: Should generate PDF files from invoice data via API

Authentication & Authorization

Tests API authentication and authorization mechanisms

Expected: Should properly handle authentication bypass for test endpoints

Input Validation

Tests API input validation and error responses

Expected: Should reject invalid inputs and return appropriate error messages

Error Handling

Tests API error handling for various failure scenarios

Expected: Should handle errors gracefully with proper HTTP status codes

Database Operations

Test database connectivity and operations

Database Connection

Tests MongoDB connection and basic database operations

Expected: Should connect to MongoDB and perform basic queries successfully

Company Model Operations

Tests company model CRUD operations and validations

Expected: Should create, read, update, delete companies with proper validation

Invoice Model Operations

Tests invoice model operations and relationships

Expected: Should manage invoice data with proper company relationships

Recipient Model Operations

Tests recipient data management and storage

Expected: Should store and retrieve recipient information correctly

Transaction Integrity

Tests database transaction integrity and rollback scenarios

Expected: Should maintain data consistency during complex operations

Schema Consistency

Tests database schema consistency and model validations

Expected: Should enforce schema rules and validate data integrity

Internationalization

Test language switching and localization

Language Switching

Tests language switching functionality between English and Chinese

Expected: Should switch languages and display correct translations

Translation Completeness

Tests completeness of translations for all supported languages

Expected: Should have complete translations for all UI elements

Currency Formatting

Tests currency formatting for different locales and currencies

Expected: Should format currencies correctly according to locale settings

Date Formatting

Tests date formatting for different locales and formats

Expected: Should format dates according to locale-specific conventions

Mixed Content Prevention

Tests detection and prevention of mixed language content

Expected: Should detect and handle mixed language content appropriately