diff --git a/TEST_GUIDE.md b/TEST_GUIDE.md index ca3006c..98dc982 100644 --- a/TEST_GUIDE.md +++ b/TEST_GUIDE.md @@ -55,3 +55,69 @@ Please test each step in order and report any errors (console errors, wrong text 34. Enter your PIN from Step 1 and click **Anmelden** 35. ✅ Expected: You're signed in to the existing `Max` account and redirected to the feed 36. Alternatively, click **Anderen Namen wählen** — ✅ Expected: the name input reappears with `max` pre-filled so you can edit it + +--- + +## Admin & Host Features + +For these steps you need an admin session. Log in via the admin API (or use the curl command below): + +```bash +curl -s -X POST http://localhost:3000/api/v1/admin/login \ + -H 'Content-Type: application/json' \ + -d '{"password":"admin123"}' | python3 -m json.tool +``` + +Copy the `jwt` value — you'll need it for the Authorization header in curl commands. +To use the admin dashboard in the browser, paste the token into DevTools console: + +```js +localStorage.setItem('token', ''); +localStorage.setItem('role', 'admin'); +``` + +Then navigate to **http://localhost:5173/admin**. + +### Step 10 — Admin Dashboard: Stats & Config +1. Go to **http://localhost:5173/admin** +2. ✅ Expected: Stats card shows user count, upload count, comment count, and a disk-usage progress bar +3. In the **Konfiguration** section, change **Upload-Limit pro Stunde** to a different value (e.g. `5`) and click **Speichern** +4. ✅ Expected: Toast "Konfiguration gespeichert." appears briefly +5. Reload — ✅ Expected: the changed value persists + +### Step 11 — Admin Dashboard: Export Jobs +6. The **Export-Jobs** section shows all past jobs (likely empty if gallery hasn't been released yet) +7. Click **Aktualisieren** — ✅ Expected: list refreshes without a full page reload + +### Step 12 — Host Dashboard: Event Controls +8. Navigate to **http://localhost:5173/host** (or click "Host-Dashboard" from the admin page) +9. ✅ Expected: Event name shown in the header; two status dots (Uploads open/locked, Export released/locked) +10. Click **Uploads sperren** +11. ✅ Expected: Toast "Uploads wurden gesperrt."; button changes to "Uploads wieder öffnen"; status dot turns red +12. Try uploading a photo as a guest — ✅ Expected: "Uploads sind gesperrt." error +13. Click **Uploads wieder öffnen** — ✅ Expected: dot turns green; uploads work again + +### Step 13 — Host Dashboard: User Management +14. The **Gäste** list shows all registered users with upload counts and sizes +15. Find a guest and click **Host** next to their name +16. ✅ Expected: Toast "X ist jetzt Host."; a blue "Host" badge appears next to their name +17. As admin, a **Degradieren** button is now visible — click it +18. ✅ Expected: Toast "X ist jetzt Gast."; badge disappears + +### Step 14 — Host Dashboard: Ban & Unban +19. Click **Sperren** next to a guest +20. ✅ Expected: A confirmation modal opens asking what to do with their uploads, with a checkbox "Uploads aus der Galerie ausblenden" +21. Leave the checkbox unchecked and click **Sperren** +22. ✅ Expected: Toast "X wurde gesperrt."; a red "Gesperrt" badge appears; buttons change to **Entsperren** +23. Try uploading as that banned user — ✅ Expected: "Du bist gesperrt." error +24. Click **Entsperren** — ✅ Expected: ban lifted; badge gone + +### Step 15 — Gallery Release & Export +25. Make sure you have at least a few photos uploaded, then on the Host Dashboard click **Galerie freigeben** +26. ✅ Expected: Toast "Galerie wurde freigegeben. Export wird vorbereitet…"; button becomes disabled "Galerie bereits freigegeben" +27. Navigate to **http://localhost:5173/export** as any logged-in user +28. ✅ Expected: Two cards — **ZIP-Archiv** and **HTML-Viewer** — both initially showing "Wird vorbereitet…" or a progress bar +29. Wait for both to show "Bereit zum Download" (reload or wait for SSE to update the UI) +30. Click **Download** on the ZIP card — ✅ Expected: `Gallery.zip` downloads +31. Click **Download** on the HTML card — ✅ Expected: A guide modal appears explaining how to open the file; click **Herunterladen** to get `Memories.zip` +32. In the Admin Dashboard → **Export-Jobs**, click **Aktualisieren** — ✅ Expected: both jobs show "Fertig" with green badges