Fix search form duplication by updating event handler to submit the correct filter form and return JSON responses for park suggestions

This commit is contained in:
pacnpal
2025-02-23 12:05:26 -05:00
parent 1ca1362fee
commit 401449201c
8 changed files with 337 additions and 70 deletions

View File

@@ -24,21 +24,28 @@ uv run pytest --cov=parks parks/tests/
## Test Coverage
### Search API Tests
- `test_search_json_format`: Validates API response structure
- `test_empty_search_json`: Tests empty search handling
- `test_search_format_validation`: Verifies all required fields and types
- `test_suggestion_limit`: Confirms 8-item result limit
### Search Functionality Tests
- `test_autocomplete_results`: Validates real-time suggestion filtering
- `test_search_form_valid`: Ensures form validation works
- `test_autocomplete_class`: Verifies autocomplete configuration
- `test_search_with_filters`: Tests filter integration
- `test_search_with_filters`: Tests filter integration with search
- `test_partial_match_search`: Verifies partial text matching works
### Integration Tests
- `test_empty_search`: Tests default behavior
- `test_partial_match_search`: Validates partial text matching
- `test_htmx_request_handling`: Ensures HTMX compatibility
- `test_view_mode_persistence`: Verifies view state preservation
### UI Integration Tests
- `test_view_mode_persistence`: Ensures view mode is maintained
- `test_empty_search`: Tests default state behavior
- `test_htmx_request_handling`: Validates HTMX interactions
### Performance Tests
- `test_suggestion_limit`: Verifies 8-item limit on suggestions
- `test_search_debounce`: Confirms proper debounce headers
### Data Format Tests
- Field types validation
- Location formatting
- Status display formatting
- URL generation
- Response structure
### Frontend Integration
- HTMX partial updates