mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-19 05:10:30 +00:00
✨ Add next_event to Lecturer API responses and tests
- ➕ Extend `withDetails` flag in Lecturer API to include `next_event` (date of the next course event or null). - 🧪 Update feature tests to assert presence and validity of `next_event` in responses.
This commit is contained in:
@@ -93,8 +93,9 @@ it('returns all lecturers with details on GET /api/lecturers?withDetails', funct
|
||||
$first = collect($response->json())->firstWhere('id', $lecturers->first()->id);
|
||||
|
||||
expect($first)
|
||||
->toHaveKeys(['id', 'name', 'subtitle', 'image', 'future_events_count'])
|
||||
->and($first['future_events_count'])->toBe(2);
|
||||
->toHaveKeys(['id', 'name', 'subtitle', 'image', 'future_events_count', 'next_event'])
|
||||
->and($first['future_events_count'])->toBe(2)
|
||||
->and($first['next_event'])->not->toBeNull();
|
||||
});
|
||||
|
||||
it('shows a lecturer profile with courses on GET /api/lecturers/{lecturer}', function () {
|
||||
|
||||
Reference in New Issue
Block a user