]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/BooksApiTest.php
respective book and chapter structure added.
[bookstack] / tests / Api / BooksApiTest.php
index b8c2b613387ef79a156ecc783e5e9dd067083bca..0de98dc323bf5ab14f8630075696a97a3f7e6118 100644 (file)
@@ -149,6 +149,23 @@ class BooksApiTest extends TestCase
         ]);
     }
 
+    public function test_read_endpoint_contents_nested_pages_has_permissions_applied()
+    {
+        $this->actingAsApiEditor();
+
+        $book = $this->entities->bookHasChaptersAndPages();
+        $chapter = $book->chapters()->first();
+        $chapterPage = $chapter->pages()->first();
+        $customName = 'MyNonVisiblePageWithinAChapter';
+        $chapterPage->name = $customName;
+        $chapterPage->save();
+
+        $this->permissions->disableEntityInheritedPermissions($chapterPage);
+
+        $resp = $this->getJson($this->baseEndpoint . "/{$book->id}");
+        $resp->assertJsonMissing(['name' => $customName]);
+    }
+
     public function test_update_endpoint()
     {
         $this->actingAsApiEditor();