]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/ChaptersApiTest.php
Default chapter templates: Updated api docs and tests
[bookstack] / tests / Api / ChaptersApiTest.php
index 81a91887794f693acaa5d6df28df9dfca259b716..fdb80a4973eb761dfbb65437337314da4628ccb3 100644 (file)
@@ -35,6 +35,7 @@ class ChaptersApiTest extends TestCase
     {
         $this->actingAsApiEditor();
         $book = $this->entities->book();
+        $templatePage = $this->entities->templatePage();
         $details = [
             'name'        => 'My API chapter',
             'description' => 'A chapter created via the API',
@@ -46,6 +47,7 @@ class ChaptersApiTest extends TestCase
                 ],
             ],
             'priority' => 15,
+            'default_template_id' => $templatePage->id,
         ];
 
         $resp = $this->postJson($this->baseEndpoint, $details);
@@ -147,6 +149,7 @@ class ChaptersApiTest extends TestCase
                     'name' => $page->name,
                 ],
             ],
+            'default_template_id' => null,
         ]);
         $resp->assertJsonCount($chapter->pages()->count(), 'pages');
     }
@@ -155,6 +158,7 @@ class ChaptersApiTest extends TestCase
     {
         $this->actingAsApiEditor();
         $chapter = $this->entities->chapter();
+        $templatePage = $this->entities->templatePage();
         $details = [
             'name'        => 'My updated API chapter',
             'description' => 'A chapter updated via the API',
@@ -165,6 +169,7 @@ class ChaptersApiTest extends TestCase
                 ],
             ],
             'priority'    => 15,
+            'default_template_id' => $templatePage->id,
         ];
 
         $resp = $this->putJson($this->baseEndpoint . "/{$chapter->id}", $details);