mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-20 17:50:12 +02:00
Add comprehensive automated testing infrastructure
Backend: - pytest configuration with async support and coverage - Unit tests for notification service (23 tests) - Unit tests for smart plug manager (12 tests) - Unit tests for archive service (16 tests) - Integration tests for API endpoints - Fix: notifications now send immediately (digest is summary only) Frontend: - Vitest configuration with jsdom and coverage - MSW for API mocking - Component tests for Toggle, Button, Card, ConfirmModal (77 tests) - Test utilities with custom render wrapper CI/CD: - GitHub Actions workflow for automated testing - Backend lint, unit tests, integration tests - Frontend lint, type-check, unit tests, build
This commit is contained in:
@@ -491,13 +491,16 @@ class NotificationService:
|
||||
):
|
||||
"""Send notification to multiple providers and log the results.
|
||||
|
||||
Args:
|
||||
force_immediate: If True, bypass digest mode and send immediately (for alarms)
|
||||
All notifications are always sent immediately. If digest mode is enabled,
|
||||
the notification is ALSO queued for the daily digest summary.
|
||||
"""
|
||||
for provider in providers:
|
||||
try:
|
||||
# Check if provider wants digest mode (unless force_immediate is set)
|
||||
if not force_immediate and provider.daily_digest_enabled and provider.daily_digest_time:
|
||||
# Always send notification immediately
|
||||
success, error = await self._send_to_provider(provider, title, message)
|
||||
|
||||
# Also queue for digest if enabled (digest is a summary, not a queue)
|
||||
if provider.daily_digest_enabled and provider.daily_digest_time:
|
||||
await self._queue_for_digest(
|
||||
provider=provider,
|
||||
event_type=event_type,
|
||||
@@ -507,9 +510,6 @@ class NotificationService:
|
||||
printer_id=printer_id,
|
||||
printer_name=printer_name,
|
||||
)
|
||||
continue
|
||||
|
||||
success, error = await self._send_to_provider(provider, title, message)
|
||||
await self._update_provider_status(db, provider.id, success, error if not success else None)
|
||||
await self._log_notification(
|
||||
db=db,
|
||||
|
||||
Reference in New Issue
Block a user