maziggy
83cbac04b7
- Add interactive API Browser to Settings > API Keys
...
- New APIBrowser component with full OpenAPI schema integration
- Fetches and parses /openapi.json automatically
- Groups endpoints by API tags (printers, archives, settings, etc.)
- Expandable endpoint sections with color-coded method badges
- Path parameter, query parameter, and JSON body editors
- Auto-populates request body with schema examples
- Live API request execution with response display
- Response shows status code, timing, and formatted JSON
- Copy response button with clipboard fallback
- Search to filter endpoints across all categories
- Expand All / Collapse All buttons
- Link to Swagger UI (/docs)
- Two-column layout for API Keys tab
- Left: API key management + webhook documentation
- Right: API Browser with dedicated test key input
- Parameter validation
- Shows warning for missing required parameters
- Validates before sending requests to avoid 422 errors
- UX improvements
- "Use in API Browser" button on newly created keys
- Responsive layout (stacked on mobile, side-by-side on xl+)
2026-01-02 15:00:21 +01:00
maziggy
f7cde95bbb
Tests Added Summary:
...
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)
2025-12-12 11:15:59 +01:00