mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 19:21:33 +02:00
Backend Tests (New Files)
1. backend/tests/integration/test_camera_api.py - 13 tests
- Camera stop endpoint (GET and POST methods)
- Active stream termination
- Printer-specific stream stopping
- Camera test endpoint
- Camera snapshot endpoint
- Camera stream validation
2. backend/tests/integration/test_system_api.py - 16 tests
- System info endpoint structure
- App, database, storage, memory, CPU sections
- Helper functions (format_bytes, format_uptime)
- Archive statistics
- Printer connection info
3. backend/tests/unit/services/test_telemetry.py - 16 tests
- Installation ID creation/retrieval
- Telemetry enabled/disabled checks
- Telemetry URL configuration
- Heartbeat sending and rate limiting
- Exception handling
4. backend/tests/unit/services/test_notification_service.py (updated) - Added TestNotificationVariableFallbacks class with 9 tests
- Duration formatting with None values
- Print complete fallback values
- Estimated time and remaining time fallbacks
- Filename fallback to "Unknown"
Frontend Tests (New Files)
5. frontend/src/__tests__/pages/SystemInfoPage.test.tsx - 14 tests
- Loading and error states
- Application, database, storage, memory, CPU sections
- Connected printers display
- Disk usage warning/danger colors
- Refresh button
6. frontend/src/__tests__/components/AMSHistoryModal.test.tsx - 21 tests
- Modal open/close behavior
- Humidity/temperature mode switching
- Time range selection
- Statistics cards (current, avg, min, max)
- Loading and error states
- Trend calculation
7. frontend/src/__tests__/components/NotificationProviderCard.test.tsx (updated) - Added NotificationProviderCard AMS toggles describe block with 11 tests
- AMS humidity/temperature notification toggles
- AMS-HT humidity/temperature notification toggles
- Independence of AMS and AMS-HT toggles
- Default values
Total New Tests: ~100 tests covering:
- Camera API endpoints
- System info API
- Anonymous telemetry service
- Notification variable fallbacks
- System Info page UI
- AMS History modal UI
- AMS/AMS-HT notification toggle settings
Tests Added - Complete Summary:
Backend Tests (4 new files, 1 updated)
| File | Tests | Description |
|------------------------------------------------------------|-------|-----------------------------------------------------------------|
| tests/integration/test_camera_api.py | 13 | Camera stop (GET/POST), snapshot, stream, test endpoints |
| tests/integration/test_system_api.py | 16 | System info API, helper functions (format_bytes, format_uptime) |
| tests/unit/services/test_telemetry.py | 16 | Installation ID, telemetry toggle, heartbeat sending |
| tests/unit/services/test_notification_service.py (updated) | +10 | Variable fallbacks for duration, filename, estimated_time |
Frontend Tests (2 new files, 1 updated)
| File | Tests | Description |
|----------------------------------------------------------------------|-------|-------------------------------------------------------|
| src/__tests__/pages/SystemInfoPage.test.tsx | 14 | System info page UI, sections, loading/error states |
| src/__tests__/components/AMSHistoryModal.test.tsx | 21 | AMS history modal, mode switching, time ranges, stats |
| src/__tests__/components/NotificationProviderCard.test.tsx (updated) | +11 | AMS/AMS-HT notification toggle independence |
Total: 101 new tests
- Backend: 335 tests total (all passing)
- Frontend: 124 tests total (all passing)