Testing Overview
Orphelix has comprehensive test coverage with 300+ tests across unit and E2E testing:Unit Tests
214 tests with Vitest
- Component tests
- Hook tests
- Utility function tests
E2E Tests
93 tests with Playwright
- User flow testing
- Integration testing
- Visual regression testing
Running Tests
Unit Tests
E2E Tests
Test Structure
Unit Tests Location
E2E Tests Location
Writing Unit Tests
Component Testing Example
Hook Testing Example
Writing E2E Tests
Page Testing Example
User Flow Testing
Test Coverage
Current coverage (as of latest):| Category | Coverage |
|---|---|
| Statements | 78% |
| Branches | 72% |
| Functions | 81% |
| Lines | 78% |
View Coverage Report
Testing with Real Cluster
Prerequisites
Kubernetes Cluster
Kubernetes Cluster
Access to a K8s cluster (Minikube, Kind, or cloud provider)
kubectl
kubectl
Configured and authenticated
Permissions
Permissions
Read access to resources in target namespace
Setup Test Cluster
Option 1: Minikube
Option 2: Kind
Test Real Mode
1
Start application
2
Click 'DEMO MODE' badge
Switch from demo to real cluster
3
Select kubectl context
Choose your test cluster context
4
Test connection
Click “Test Connection” to verify access
5
Switch mode
Click “Switch to Real Cluster”
6
Verify data
Confirm you see real resources from your cluster
CI/CD Testing
GitHub Actions
Tests run automatically on every push and PR:Best Practices
Write tests for new features
Write tests for new features
Every new component or feature should include tests
Test edge cases
Test edge cases
Don’t just test happy paths - test errors, loading states, and edge cases
Use data-testid
Use data-testid
Add
data-testid attributes for reliable E2E selectorsMock external dependencies
Mock external dependencies
Mock API calls, K8s client, and other external dependencies in unit tests
Keep tests fast
Keep tests fast
Unit tests should run in milliseconds, E2E tests in seconds
Troubleshooting
Tests timing out
Tests timing out
Increase timeout in test file:
E2E tests failing locally
E2E tests failing locally
Make sure dev server is running:
Module not found errors
Module not found errors
Clear cache and reinstall: