test overdue dashboard assignments

This commit is contained in:
Yisroel Baum 2026-08-18 00:13:24 +03:00
parent 2c38b01562
commit 7bc7ad207b
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 42 additions and 26 deletions

View file

@ -225,7 +225,7 @@ class ScheduleEndpointTest extends TestCase
]);
}
public function test_it_lists_the_users_assignments_for_a_date(): void
public function test_it_lists_the_users_assignments_due_through_a_date(): void
{
$user = $this->createUser('reader@example.com');
$otherUser = $this->createUser('other@example.com');
@ -255,8 +255,8 @@ class ScheduleEndpointTest extends TestCase
$this->credentialedPost('/api/schedules', [
'setId' => $olderSet->getId(),
'levelId' => $olderLevel->getId(),
'startDate' => '2026-08-15',
'targetDate' => '2026-08-15',
'startDate' => '2026-08-14',
'targetDate' => '2026-08-14',
])->assertCreated();
$this->credentialedPost('/api/schedules', [
'setId' => $newerSet->getId(),
@ -286,22 +286,9 @@ class ScheduleEndpointTest extends TestCase
->assertExactJson([
'date' => '2026-08-15',
'assignments' => [
[
'id' => 3,
'schedule' => [
'id' => 2,
'set' => [
'name' => 'Newer course',
],
],
'element' => [
'name' => 'Only chapter',
'kind' => 'chapter',
'path' => ['Only chapter'],
],
],
[
'id' => 1,
'scheduledDate' => '2026-08-14',
'schedule' => [
'id' => 1,
'set' => [
@ -316,6 +303,7 @@ class ScheduleEndpointTest extends TestCase
],
[
'id' => 2,
'scheduledDate' => '2026-08-14',
'schedule' => [
'id' => 1,
'set' => [
@ -328,6 +316,21 @@ class ScheduleEndpointTest extends TestCase
'path' => ['Second lesson'],
],
],
[
'id' => 3,
'scheduledDate' => '2026-08-15',
'schedule' => [
'id' => 2,
'set' => [
'name' => 'Newer course',
],
],
'element' => [
'name' => 'Only chapter',
'kind' => 'chapter',
'path' => ['Only chapter'],
],
],
],
]);
}