# S02: Sort Controls on All List Views — UAT

**Milestone:** M012
**Written:** 2026-04-01T06:35:19.121Z

# S02 UAT: Sort Controls on All List Views

## Preconditions
- Chrysopedia running at ub01:8096
- At least 5 technique pages in the database with different creators and created_at dates
- Browser with sessionStorage available (not incognito with storage blocked)

## Test Cases

### TC1: Search Results Sort Dropdown Visible
1. Navigate to ub01:8096
2. Type "bass" in the search bar and submit
3. **Expected:** Search results page shows a sort dropdown in the results header area
4. **Expected:** Default selection is "Relevance" when arriving from a search query

### TC2: Search Results Sort by Alphabetical
1. From TC1, change sort dropdown to "A → Z"
2. **Expected:** Results reorder so titles are in ascending alphabetical order
3. Note the first 3 titles — they should be alphabetically sequential

### TC3: Search Results Sort by Newest
1. Change sort dropdown to "Newest"
2. **Expected:** Results reorder with most recently created techniques first

### TC4: Search Results Sort by Creator
1. Change sort dropdown to "Creator"
2. **Expected:** Results group by creator name in alphabetical order

### TC5: SubTopic Page Sort Dropdown
1. Navigate to Topics → Sound Design → Bass (or any subtopic with multiple techniques)
2. **Expected:** Sort dropdown visible, defaulting to "A → Z"
3. Change to "Oldest"
4. **Expected:** Techniques reorder by ascending created_at date

### TC6: Creator Detail Page Sort Dropdown
1. Navigate to Creators → click any creator with multiple techniques
2. **Expected:** Sort dropdown visible, defaulting to "Newest"
3. Change to "A → Z"
4. **Expected:** Techniques reorder alphabetically by title

### TC7: Session Persistence Across Navigation
1. On search results page, set sort to "A → Z"
2. Navigate to Topics page, then to a subtopic
3. **Expected:** Subtopic page sort dropdown shows "A → Z" (persisted from search)
4. Navigate back to search, search for "snare"
5. **Expected:** Sort dropdown still shows "A → Z", not reset to default

### TC8: Sort Resets Pagination
1. On search results with enough results for pagination, navigate to page 2
2. Change the sort dropdown value
3. **Expected:** Results refresh and pagination resets to page 1/first offset

### TC9: Sort Options Are Context-Appropriate
1. On Search Results page, open sort dropdown
2. **Expected:** Options include Relevance, Newest, Oldest, A → Z, Creator
3. On SubTopic page, open sort dropdown
4. **Expected:** Options include A → Z, Newest, Oldest, Creator (no Relevance)
5. On Creator Detail page, open sort dropdown
6. **Expected:** Options include Newest, Oldest, A → Z (no Relevance, no Creator)

### TC10: Backend API Sort Param
1. `curl 'http://ub01:8096/api/v1/search?q=bass&sort=alpha'` — verify titles in alphabetical order
2. `curl 'http://ub01:8096/api/v1/topics/sound-design/bass?sort=oldest'` — verify ascending dates
3. `curl 'http://ub01:8096/api/v1/techniques?sort=creator'` — verify grouped by creator name

### Edge Cases

### TC11: Sort with No Results
1. Search for a nonsense query like "xyzzy12345"
2. **Expected:** Sort dropdown either hidden or present but non-functional (no crash)

### TC12: Sort on Fresh Session
1. Open a new browser tab (or clear sessionStorage)
2. Navigate directly to a subtopic page
3. **Expected:** Sort defaults to page-specific default (A → Z for subtopic), not undefined
