# Testing Strategy & Quality Assurance

Comprehensive automated and manual testing procedures ensuring high availability, concurrency safety, and flawless hotel guest experiences.

---

## 1. Automated Test Suites

### 1.1 Backend Feature & Unit Tests (PHPUnit / Pest)
- **Authentication & RBAC:** Verifies role permissions, route protection, and session security.
- **Availability Engine:** Validates that overlapping reservations, temporary holds, and out-of-order rooms accurately reduce available inventory.
- **Booking Concurrency & Overbooking Prevention:** Simulates simultaneous booking attempts on the last available room.
- **Pesapal Payment Verification:** Tests OAuth token caching, order creation, and idempotent IPN payment updates.
- **Folio Accounting & Settlements:** Tests posting charges, tax calculations, applying discounts, split payments, and balance zeroing.
- **Housekeeping Status Flow:** Tests room state transitions (`Dirty` -> `Assigned` -> `Cleaning` -> `Clean` -> `Inspected` -> `Ready`).

---

## 2. Frontend & Cross-Device QA Acceptance
- **Responsive Viewport Testing:** Verified on Mobile (360px, 375px, 390px, 412px, 430px), Tablet (768px, 1024px), and Desktop (1440px, 1920px).
- **Core Web Vitals:** First Contentful Paint (FCP) < 1.2s, Largest Contentful Paint (LCP) < 2.0s, Cumulative Layout Shift (CLS) < 0.05.
- **Accessibility (WCAG 2.1 AA):** Contrast ratio > 4.5:1, semantic landmarks, aria labels on interactive modals, and keyboard accessibility.
