Skip to content

test: Admin Core — Settings, Appearance, Users, Enrollments, Categories #297

Description

@guillermoscript

Scope

Admin operational pages that were not covered by analytics/reporting or billing issues.

Personas

Persona Email Role
Admin/Owner owner@e2etest.com admin (Default School)

Routes Under Test

Route Description
/dashboard/admin/settings General, Email, Payment, Enrollment settings
/dashboard/admin/appearance Branding: logo, colors, theme
/dashboard/admin/users User management: list, invite, role management
/dashboard/admin/users/[userId] Individual user detail: profile, enrollments, role change
/dashboard/admin/enrollments All student enrollments — search, filter, status change
/dashboard/admin/categories Course category CRUD
/dashboard/admin/api-tokens API token management
/dashboard/admin/notifications Notification settings and history
/dashboard/admin/notifications/templates Custom notification templates

Test Cases

Settings (/dashboard/admin/settings)

  • General: site name, description, contact email — save persists to system_settings
  • Email: SMTP config fields render (values hidden, not shown in plaintext)
  • Payment: payment method toggle (stripe/manual), webhook URL shown
  • Enrollment: auto-approve toggle, enrollment limits

Appearance (/dashboard/admin/appearance)

  • Upload school logo → stored in Supabase storage, visible in navbar
  • Primary color picker → changes tenant_settings.primary_color
  • Color change propagates to CSS custom properties (tenant theming)
  • Dark mode preview works

User Management (/dashboard/admin/users)

  • User list loads with name, role, join date
  • Search by name filters list
  • Filter by role (student/teacher/admin)
  • Invite user → sends email, creates pending tenant_users row
  • Role change (student → teacher) → updates tenant_users.role
  • Removing user → removes from tenant_users (does not delete auth user)

User Detail (/dashboard/admin/users/[userId])

  • Profile info: name, email (fetched via admin auth), join date
  • Enrollment list for that user
  • Role badge editable

Enrollments (/dashboard/admin/enrollments)

  • All active enrollments listed
  • Filter by course
  • Filter by status (active/disabled)
  • Manual enroll student → creates enrollment record
  • Disable enrollment → sets status to disabled

Categories (/dashboard/admin/categories)

  • Create category: name, slug, description
  • Edit category
  • Delete category (confirm: courses using it need handling)
  • Categories appear in course creation form

API Tokens (/dashboard/admin/api-tokens)

  • Generate new token → shown once, then masked
  • Revoke token → removed from DB
  • Token list shows name, created date, last used

Notifications

  • Notification history lists sent notifications
  • Templates: create/edit notification template
  • Send test notification to a user

Definition of Done

  • All settings save to DB and reflect on next load
  • Appearance changes visible immediately on school subdomain
  • User invite sends email (or logs in dev mode)
  • Enrollment management works without breaking RLS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions