test that todays schedule only returns uncompleted nodes
This commit is contained in:
parent
8eeff2c4fe
commit
e04931ac08
2 changed files with 25 additions and 1 deletions
|
|
@ -87,4 +87,27 @@ class GetTodaysScheduleTest extends TestCase
|
|||
));
|
||||
$this->assertEquals(2, count($result));
|
||||
}
|
||||
|
||||
public function test_only_returns_uncompleted_nodes(): void
|
||||
{
|
||||
$node = $this->scheduledNodeRepo->create(
|
||||
new CreateScheduledNodeDto(
|
||||
date: new DateTimeImmutable('2025-01-01'),
|
||||
plan: $this->planRepo->find(0),
|
||||
node: new Node(
|
||||
id: 0,
|
||||
title: 'test node',
|
||||
text: new Text(id: 0, name: 'test text'),
|
||||
parentNode: null,
|
||||
),
|
||||
));
|
||||
$node->setCompleted(true);
|
||||
$this->scheduledNodeRepo->update($node);
|
||||
|
||||
$result = $this->useCase->execute(new GetTodaysScheduleRequest(
|
||||
date: '2025-01-02',
|
||||
userId: 0,
|
||||
));
|
||||
$this->assertEquals(1, count($result));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue