Files
amare/openspec/changes/archive/2026-08-11-enhance-public-motion/specs/testimonials/spec.md

44 lines
2.4 KiB
Markdown

## MODIFIED Requirements
### Requirement: Testimonials are managed with publication control
The system SHALL allow admins to manage testimonials (SPEC WEB-04) with quote text (including multi-paragraph content), author name, optional context (event type and/or date), optional photo with alt text, sort order, featured flag, and `published_at`. Public rendering MUST preserve paragraph breaks from the stored quote, MUST omit blank/whitespace-only quotes before creating the rendered sequence, and MUST assign alternating `left`/`right` reveal directions according to the remaining rendered column order at desktop and mobile viewports. Testimonials sourced from real clients MUST NOT be published to production without authorization; development seeds MAY include the authorized-pending real quotes marked for review.
#### Scenario: Unpublished testimonial is excluded
- **WHEN** a testimonial has `published_at` null
- **THEN** the `published()` scope MUST exclude it
#### Scenario: Published testimonial is queryable
- **WHEN** an admin sets `published_at` with required quote and author name
- **THEN** the testimonial MUST be included in the `published()` scope
#### Scenario: Assistant cannot manage testimonials
- **WHEN** an assistant attempts to access the testimonials Resource
- **THEN** access MUST be denied with HTTP 403
#### Scenario: Featured testimonials are filterable
- **WHEN** content is queried with featured filter
- **THEN** records with `is_featured` true MUST be retrievable independently of sort order
#### Scenario: Multi-paragraph quotes render as paragraphs
- **GIVEN** a published testimonial whose quote contains blank-line separated paragraphs
- **WHEN** the home testimonials section is rendered
- **THEN** each paragraph MUST appear as distinct block text rather than a single collapsed line
#### Scenario: Blank quotes do not affect alternation
- **GIVEN** the published testimonial collection contains a blank quote between two non-blank quotes
- **WHEN** the home testimonials section is rendered
- **THEN** the blank testimonial MUST be omitted
- **AND** the two rendered testimonials MUST receive alternating `left` and `right` directions based on their rendered order
#### Scenario: Direction alternation remains on mobile
- **WHEN** testimonials are viewed at a mobile viewport
- **THEN** their explicit `left` and `right` directions MUST be preserved with the reduced mobile distance