# User Functional Test Spec (UI + CalDAV, ~1 Hour)

## Goal
Exercise the highest-value user flows across web UI, admin setup/users pages, recurrence logic, ICS, and CalDAV synchronization within 60 minutes.

## Preconditions (5 minutes)
- Tester has:
  - WordPress admin account
  - one approved calendar user account (for UI + CalDAV write tests)
  - one pending user account (for approval flow checks)
- Test calendar client available (for example Thunderbird).
- Plugin active and calendar page with `[calendar]` exists.

## Test Plan

### 1. Setup Page (8 minutes)
- Open Setup.
- Verify controls are present and usable:
  - CalDAV/ICS calendar name
  - URL slug
  - plugin table prefix
  - diagnostics enabled
  - uninstall cleanup mode
  - buttons: Save Settings, Seed Events, Delete All Events Data
- Click `Seed Events`.
- Confirm success message appears.

### 2. Users Admin Flow (6 minutes)
- Open Users page.
- Verify pending user appears.
- Approve pending user.
- Remove a defunct test user (if present) and verify list refreshes.

### 3. Calendar UI Auth + CRUD (12 minutes)
- Open calendar page in logged-out mode; verify read-only behavior.
- Log in as approved user.
- Create a single timed event.
- Edit same event (title/category/location/description).
- Delete the event.
- Confirm list/month views update after each operation.

### 4. Recurrence + Exception UX (12 minutes)
- Create a recurring event (daily or weekly).
- Re-open event and confirm recurrence preview pane is visible.
- Select one occurrence in preview (verify visual highlight).
- Deselect and reselect to verify toggle behavior.
- Click `Delete Occurrence` and confirm selected occurrence disappears while series remains.

### 5. CalDAV Round-Trip (10 minutes)
- In CalDAV client:
  - subscribe/connect using approved account.
  - create one event.
  - edit one event.
  - delete one single occurrence from a recurring series.
- In web UI:
  - refresh and confirm all CalDAV changes are reflected.

### 6. ICS + Diagnostics (7 minutes)
- Open ICS URL and confirm file downloads and contains seeded + user-created events.
- Open Diagnostics page:
  - verify diagnostics snapshot renders.
  - click `Download Diagnostics` and confirm JSON file downloads.
- Render/check page area using `[calendar_sidebar_upcoming]`:
  - confirm human-readable date/time format.
  - confirm displayed times match `Europe/London` (not server UTC) for near-term timed events.

## Pass Criteria
- No fatal errors.
- CRUD works from UI and CalDAV.
- Single-occurrence delete creates exception without splitting series.
- Admin controls behave as expected.
- Diagnostics download works as attachment.

## Failure Notes Template
- Step:
- Expected:
- Actual:
- URL/page/client:
- Timestamp (local):
- Screenshot/log reference:
