feat: add e2e tests for likes and fix like_count propagation in DTO mapping
All checks were successful
ci/woodpecker/pr/pipeline Pipeline was successful

- Write 3 e2e tests (TC-E2E-106-108): like/unlike flow, multi-user like, guest redirect
- Add get_like_count() and click_like() to PostDetailPage object
- Fix _map_to_dto in 5 use cases (create, get, list, publish, update) to include like_count
- Fix pre-existing mypy issues in page object (evaluate returns Any)
- Update FEATURE_LIKES.md with verified E2E status
This commit is contained in:
2026-05-10 21:11:28 +03:00
parent c8e19e3ce5
commit 30d9e287a7
8 changed files with 210 additions and 9 deletions

View File

@@ -173,7 +173,7 @@ guest identification, and anti-bot protection via JS-only POST.
- **Layer:** E2E
- **File:** `tests/e2e/test_likes.py::test_like_unlike_flow`
- **Scenario:** Create post → like → verify count → unlike → verify count
- **Expected:** Count toggles correctly
- **Expected:** Count toggles correctly (0→1→0)
- **Last Verified:** 2026-05-10
#### TC-E2E-107: Separate users can both like
@@ -184,12 +184,12 @@ guest identification, and anti-bot protection via JS-only POST.
- **Expected:** Count increments per user
- **Last Verified:** 2026-05-10
#### TC-E2E-108: Guest like with different sessions
#### TC-E2E-108: Guest redirect on like
- **Type:** Positive
- **Layer:** E2E
- **File:** `tests/e2e/test_likes.py::test_guest_like_different_sessions`
- **Scenario:** Guest1 likes → count=1 → different device context
- **Expected:** Different guests count separately
- **File:** `tests/e2e/test_likes.py::test_guest_redirect_on_like`
- **Scenario:** Guest opens published post → clicks like → redirected to login
- **Expected:** 401 redirects to `/auth/dev-login`
- **Last Verified:** 2026-05-10
## Coverage Summary
@@ -200,10 +200,9 @@ guest identification, and anti-bot protection via JS-only POST.
| Domain Entities (PostLike, Post) | 2 | ✅ Verified |
| API Endpoints | 4 | ✅ Verified |
| Web Display | 3 | ⬜ Planned |
| E2E Flows | 3 | ⬜ Planned |
| E2E Flows | 3 | ✅ Verified |
## Gaps (Not Yet Covered)
- [ ] Web tests (TC-WEB-001003) — test infrastructure pending
- [ ] E2E tests (TC-E2E-106108) — test infrastructure pending
- [ ] Full device_id middleware for guest like support