Dieses Guide erklärt, wie du die Notification-Logik LIVE in der App testest.
npm start- Scannen Sie den QR-Code mit der Expo Go App
- Oder drücken Sie
ifür iOS /afür Android Emulator
Im Expo Dev Server Terminal:
Option A - Einfach (Kopieren & Einfügen):
import('./testNotificationsLive').then(m => m.runLiveTests())Option B - Mit Debugging:
global.testNotifications = async () => {
const { runLiveTests } = await import('./testNotificationsLive');
await runLiveTests();
};
await global.testNotifications();Die App zeigt automatisch:
- ✅ PASS Tests - alles funktioniert
- ❌ FAIL Tests - Fehler identifizieren
⚠️ SKIP Tests - Bedingungen nicht erfüllt (z.B. alle Routines abgeschlossen)
- Prüft, ob Notification-Berechtigungen granted sind
- Fordert diese an, falls nötig
- Erwartet: ✅ PASS
- Lädt gespeicherte Notification-Settings
- Prüft multipleReminders, customTimes, etc.
- Erwartet: ✅ PASS
- Lädt alle gespeicherten Routines
- Zeigt deren Status (active/inactive)
- Erwartet: ✅ PASS (wenn Routines existieren)
- Berechnet den aktuellen Completion-Status
- KRITISCH: Prüft auf False-Positives (Bug #2 Fix)
- Erwartet: ✅ PASS (zeigt echten Status)
- Scheduled tatsächlich Notifications
- KRITISCH: Prüft max 6/day Cap (Bug #4 Fix)
- Zeigt geplante Notification-Times
- Erwartet: ✅ PASS mit ≤ 6 Notifications
- KRITISCH: Prüft ob Custom Times respektiert werden (Bug #3 Fix)
- Validiert Escalation Logic
- Erwartet: ✅ PASS (Settings werden beachtet)
✅ All 6 Tests PASSED
✅ Success Rate: 100%
✅ Alle 4 Critical Bugs validiert:
- Bug #1: Notification permissions handling
- Bug #2: Real-time status (keine False-Positives)
- Bug #3: Settings respect (Custom times)
- Bug #4: Max 6/day enforcement
❌ Permission request failed
→ Überprüfe:
- Notification Permissions in App-Settings gew ährt?
- Platform ist nicht 'web'?
⚠️ No routines configured
→ Erstelle Routines in der App:
- Gehe zu Routines Tab
- Klicke "+" zum Erstellen
- Speichere die Routine
❌ Real-time status calculation issue
→ Das deutet auf Bug #2 hin:
- Status wird nicht aktuell berechnet
- Überprüfe generateNotificationContent() in notificationManager.ts
❌ Too many notifications (12 > 6)
→ Das deutet auf Bug #4 hin:
- Escalation logic wird nicht korrekt durchgesetzt
- Überprüfe scheduleRoutineNotifications() in notificationManager.ts
- Max sollte 6/day sein
❌ Custom times not respected
→ Das deutet auf Bug #3 hin:
- Settings validation layer funktioniert nicht
- Überprüfe die customTimes Prüfung in scheduleRoutineNotifications()
// In App Console:
const perms = await Notifications.requestPermissionsAsync();
console.log('Permissions:', perms.status);// In App Console:
const { loadRoutines } = await import('./utils/settingsStorage');
const routines = await loadRoutines();
console.log('Routines:', routines);// In App Console:
const { scheduleRoutineNotifications } = await import('./utils/notificationManager');
await scheduleRoutineNotifications();
const scheduled = await Notifications.getAllScheduledNotificationsAsync();
console.log('Scheduled count:', scheduled.length);
console.log('Times:', scheduled.map(n => {
const t = n.trigger;
return `${t.hour}:${t.minute}`;
}));✅ Wenn alle Tests PASS:
- Version zu 1.0.3 aktualisieren
- PRODUCTION_CHECKLIST.md durchgehen
- APK bauen:
eas build --platform android - Zu Google Play Store submitten
testNotificationsLive.ts- Main test scriptutils/notificationManager.ts- Zu testende Logikutils/settingsStorage.ts- Settings & Routines ladencomponents/NotificationTestDashboard.tsx- Optional: UI-basierte Tests
Created: Oktober 29, 2025
Version: 1.0.2
Status: Ready for Production Testing