Add comprehensive test suite: 219 new tests across backend and frontend

Backend (103 tests):
- Unit tests for listing_service, export_service, district_service
- Regression tests for API response contracts and query parameter validation
- Integration tests for API workflows, Redis listing cache, listing processor pipeline, and repository advanced queries
- E2E tests for streaming with filters, batching, caching, and task management

Frontend (116 tests):
- Service tests for apiClient, streamingService, taskService, listingService, healthService
- Hook tests for useTaskProgress (WebSocket + polling)
- Component tests for PropertyCard, FilterPanel, Header, ListView, TaskProgressDrawer, TaskIndicator, StreamingProgressBar, HealthIndicator
- E2E tests for filter-stream-display flow

Infrastructure:
- Add pytest-xdist and test markers (regression, integration, e2e)
- Add conftest fixtures: fake_redis, rent_listing_factory, seeded_repository
- Add vitest + testing-library + MSW for frontend testing
This commit is contained in:
Viktor Barzin 2026-02-10 21:59:45 +00:00
parent a3ac9cc060
commit 8d22c97320
No known key found for this signature in database
GPG key ID: 0EB088298288D958
36 changed files with 5447 additions and 19 deletions

View file

@ -0,0 +1,34 @@
"""Unit tests for services/district_service.py."""
import pytest
from services import district_service
class TestGetAllDistricts:
def test_get_all_districts_returns_dict(self):
result = district_service.get_all_districts()
assert isinstance(result, dict)
assert len(result) > 0
class TestGetDistrictNames:
def test_get_district_names_returns_list(self):
result = district_service.get_district_names()
assert isinstance(result, list)
assert len(result) > 0
class TestValidateDistricts:
def test_validate_districts_all_valid(self):
result = district_service.validate_districts(["London", "Westminster"])
assert result == []
def test_validate_districts_returns_invalid(self):
result = district_service.validate_districts(["London", "Narnia"])
assert "Narnia" in result
def test_known_districts_present(self):
names = district_service.get_district_names()
for district in ["London", "Westminster", "Camden"]:
assert district in names