test parent navigation
This commit is contained in:
parent
afc61cbd38
commit
3a9116dc3f
3 changed files with 69 additions and 0 deletions
|
|
@ -94,6 +94,7 @@ class ElementsEndpointTest extends TestCase
|
|||
'longPdfPath' => '/assets/pdfs/baderech-long.pdf',
|
||||
'youtubeUrl' => $sampleYoutubeUrl,
|
||||
],
|
||||
'parentElement' => null,
|
||||
'siblingElements' => [
|
||||
[
|
||||
'id' => $element->getId(),
|
||||
|
|
@ -151,6 +152,11 @@ class ElementsEndpointTest extends TestCase
|
|||
);
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonPath('parentElement', [
|
||||
'id' => $parentElement->getId(),
|
||||
'title' => 'Baderech HaAvodah',
|
||||
'description' => 'A structured path for growth',
|
||||
]);
|
||||
$response->assertJsonPath('siblingElements', [
|
||||
[
|
||||
'id' => $firstChildElement->getId(),
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ class ElementControllerTest extends TestCase
|
|||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
||||
$body['element']['youtubeUrl'],
|
||||
);
|
||||
$this->assertNull($body['parentElement']);
|
||||
$this->assertSame([
|
||||
[
|
||||
'id' => $firstChildElement->getId(),
|
||||
|
|
@ -202,6 +203,11 @@ class ElementControllerTest extends TestCase
|
|||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
$body = json_decode($response->getContent(), true);
|
||||
$this->assertSame([
|
||||
'id' => $parentElement->getId(),
|
||||
'title' => 'Baderech HaAvodah',
|
||||
'description' => 'A structured path for growth',
|
||||
], $body['parentElement']);
|
||||
$this->assertSame([
|
||||
[
|
||||
'id' => $firstChildElement->getId(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue