test that only nodes which are not parents are scheduled
This commit is contained in:
parent
bd2679f258
commit
844813499a
2 changed files with 33 additions and 0 deletions
|
|
@ -99,4 +99,29 @@ class CreatePlanTest extends TestCase
|
|||
));
|
||||
$this->assertNotNull($this->scheduledNodeRepo->find(0));
|
||||
}
|
||||
|
||||
public function test_plan_only_schedules_nodes_which_arent_parents(): void
|
||||
{
|
||||
$text = $this->textRepo->create(new CreateTextDto(
|
||||
name: 'testname',
|
||||
));
|
||||
$rootNode = $this->nodeRepo->create(new CreateNodeDto(
|
||||
text: $text,
|
||||
title: 'root node',
|
||||
parentNode: null,
|
||||
));
|
||||
$this->nodeRepo->create(new CreateNodeDto(
|
||||
text: $text,
|
||||
title: 'child node',
|
||||
parentNode: $rootNode,
|
||||
));
|
||||
$plan = $this->useCase->execute(new CreatePlanRequest(
|
||||
userId: 0,
|
||||
name: 'testPlan',
|
||||
textId: 0,
|
||||
));
|
||||
$this->assertEquals(
|
||||
1, $this->scheduledNodeRepo->getNumberOfTimesCreateCalled()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue