## Features Implemented ### 1. Event Rename Functionality - Add EventRenameDialog component with live slug preview - Create eventRenameService for safe event renaming - Add slug_redirects table for old URL redirects - Support optional email notification on rename - Fix date formatting in slug (YYYY-MM-DD format) ### 2. Optional Event Contact Fields - Add settings to make customer name/email/admin email optional - Create migration for field requirement settings - Update CreateEventPage forms to show "(optional)" labels - Fix boolean parsing in publicSettings.js ### 3. Photo Filtering & Export - Add PhotoFilterPanel with rating/likes/favorites/comments filters - Create PhotoExportMenu with ZIP/metadata/XMP export options - Add photoExportService with Lightroom XMP sidecar generation - Create photoFilterBuilder utility for query construction - Wire up photo selection to export button via onSelectionChange ### 4. Custom CSS Gallery Templates - Add CssTemplateEditor component with 3 template slots - Create cssSanitizer utility blocking XSS vectors - Add gallery CSS endpoint for template delivery - Integrate Custom CSS tab into Settings page - Include default "Elegant Dark" template ## Bug Fixes - Fix event rename date formatting (was showing full Date string) - Fix common.optional translation key missing in locales - Fix photo export button staying disabled when photos selected - Fix authService import missing in SettingsPage ## Documentation - Add comprehensive REFACTORING_PLAN.md for codebase improvement - Add test specification documents for all features - Add feature documentation for CSS templates ## Database Migrations - 049_add_slug_redirects.js - 050_add_optional_event_fields_settings.js - 051_add_photo_filter_indexes.js - 052_add_css_templates.js
7.9 KiB
Test Specification: Event Rename Feature
Overview
This document specifies the test cases for the Event Rename feature, which allows administrators to rename events from the admin panel.
Test Environment
- URL: http://localhost:7100
- Admin Credentials: admin / AdminTest@2026!
- Prerequisites: At least one active (non-archived) event with photos
Test Cases
TC-RN-001: Access Rename Dialog
Description: Verify the Rename button is visible and opens the rename dialog
Steps:
- Login to admin panel
- Navigate to an active event's detail page
- Verify "Rename" button is visible in the header action buttons
- Click the "Rename" button
- Verify rename dialog opens
Expected Results:
- Rename button visible next to Edit button
- Dialog opens with current event name pre-filled
- Dialog shows input field for new name
TC-RN-002: Validate New Name - Too Short
Description: Verify validation error for names shorter than 3 characters
Steps:
- Open rename dialog for an event
- Enter a name with 2 characters (e.g., "AB")
- Observe validation state
Expected Results:
- Rename button remains disabled
- No API call made for validation
TC-RN-003: Validate New Name - Same as Current
Description: Verify error when new name generates same slug as current
Steps:
- Open rename dialog for an event
- Enter the same name as current (or minor variation that results in same slug)
- Wait for validation
Expected Results:
- Error message: "New name generates the same URL as the current name"
- Rename button disabled
TC-RN-004: Validate New Name - Duplicate Slug
Description: Verify error when new name would conflict with existing event
Steps:
- Create two events with different names on the same date
- Open rename dialog for event A
- Enter event B's name
- Wait for validation
Expected Results:
- Error message: "An event with this name already exists for the same date"
- Rename button disabled
TC-RN-005: Validate New Name - Valid
Description: Verify successful validation of a valid new name
Steps:
- Open rename dialog for an event
- Enter a valid, unique new name (at least 3 characters)
- Wait for validation
Expected Results:
- New URL preview shown in green box
- Rename button becomes enabled
- No error messages
TC-RN-006: Successful Rename
Description: Verify complete rename operation
Steps:
- Open rename dialog for an event with photos
- Enter a valid new name
- Wait for validation to complete
- Click "Rename Event" button
- Wait for operation to complete
Expected Results:
- Progress indicator shown during operation
- Success message displayed
- New share link shown
- Files renamed count displayed
- Event name updated in UI
- Share link updated
TC-RN-007: Rename with Email Notification
Description: Verify rename with email notification option
Steps:
- Open rename dialog for event with customer email
- Enter valid new name
- Check "Resend invitation email with new gallery link" checkbox
- Click "Rename Event"
- Wait for completion
Expected Results:
- Operation completes successfully
- Email sent confirmation shown
- (If SMTP configured) Email received with new link
TC-RN-008: Old URL Redirects to New URL
Description: Verify old gallery URLs redirect to new location
Steps:
- Note the current gallery share link before rename
- Rename the event
- Try to access the old share link
- Verify redirect to new URL
Expected Results:
- Old URL returns 301 redirect response
- Browser redirects to new gallery URL
- Gallery is accessible at new URL
TC-RN-009: Archived Events Cannot Be Renamed
Description: Verify rename button is not available for archived events
Steps:
- Navigate to an archived event's detail page
- Check for Rename button presence
Expected Results:
- Rename button is NOT visible
- Only archive-related actions available
TC-RN-010: Rename Dialog Cancel
Description: Verify cancel functionality in rename dialog
Steps:
- Open rename dialog
- Enter a new name
- Click Cancel button
- Verify dialog closes
- Verify event name unchanged
Expected Results:
- Dialog closes
- No changes made to event
- Event name remains original
TC-RN-011: Rename Dialog Close (X Button)
Description: Verify X button closes dialog without changes
Steps:
- Open rename dialog
- Enter a new name
- Click X button in top-right
- Verify dialog closes
- Verify event name unchanged
Expected Results:
- Dialog closes
- No changes made to event
TC-RN-012: Photo File Paths Updated
Description: Verify photo file paths are updated after rename
Steps:
- Create event with photos
- Note photo paths in database
- Rename the event
- Verify photos are still accessible
- Check photo paths in database
Expected Results:
- All photos remain accessible
- Photo paths updated to reflect new slug
- Thumbnails still work
TC-RN-013: Activity Log Entry Created
Description: Verify rename operation is logged
Steps:
- Rename an event
- Check activity logs in database or admin panel
Expected Results:
- Activity log entry created with type "event_renamed"
- Metadata includes old name, new name, old slug, new slug
- Actor information recorded
API Test Cases
TC-RN-API-001: POST /api/admin/events/:id/rename
Description: Test rename API endpoint
Request:
{
"newEventName": "New Event Name",
"resendEmail": false
}
Expected Response (200):
{
"success": true,
"message": "Event renamed successfully",
"data": {
"eventId": 1,
"oldName": "Old Event Name",
"newName": "New Event Name",
"oldSlug": "wedding-old-event-name-2026-01-01",
"newSlug": "wedding-new-event-name-2026-01-01",
"newShareLink": "/gallery/wedding-new-event-name-2026-01-01/abc123...",
"emailSent": false,
"filesRenamed": 3
}
}
TC-RN-API-002: POST /api/admin/events/:id/validate-rename
Description: Test rename validation endpoint
Request:
{
"newEventName": "New Event Name"
}
Expected Response (200):
{
"valid": true,
"newSlug": "wedding-new-event-name-2026-01-01"
}
TC-RN-API-003: Rename Requires Authentication
Description: Verify API requires admin authentication
Steps:
- Call rename endpoint without auth token
- Call rename endpoint with invalid token
Expected Results:
- 401 Unauthorized response
Database Verification
TC-RN-DB-001: Events Table Updated
After successful rename, verify:
event_nameupdated to new nameslugupdated to new slugshare_linkupdated with new slug
TC-RN-DB-002: Photos Table Updated
After successful rename, verify:
pathcolumn updated for all event photosthumbnail_pathcolumn updated for all event photos
TC-RN-DB-003: Slug Redirects Table Populated
After successful rename, verify:
- Entry created in
slug_redirectstable old_slugcontains previous slugnew_slugcontains new slugevent_idreferences correct event
Error Handling
TC-RN-ERR-001: Database Error During Rename
Description: Verify rollback on database error
Expected Behavior:
- File system changes rolled back
- Original event state preserved
- Error message returned to user
TC-RN-ERR-002: File System Error During Rename
Description: Verify handling of file system errors
Expected Behavior:
- Transaction rolled back
- Error message returned to user
- Event remains unchanged
Performance
TC-RN-PERF-001: Rename Large Event
Description: Verify performance with events containing many photos
Steps:
- Create event with 100+ photos
- Rename the event
- Measure time taken
Expected Results:
- Operation completes within reasonable time
- Progress indicator keeps user informed
- All photos remain accessible