X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/85db812feaae5f36ea6214931cec4adb67a9cb39..refs/pull/2902/head:/tests/Entity/BookTest.php diff --git a/tests/Entity/BookTest.php b/tests/Entity/BookTest.php index 6c2cf30d4..b4ba2fa82 100644 --- a/tests/Entity/BookTest.php +++ b/tests/Entity/BookTest.php @@ -1,4 +1,6 @@ -get($deleteReq->baseResponse->headers->get('location')); $redirectReq->assertNotificationContains('Book Successfully Deleted'); } -} \ No newline at end of file + + public function test_next_previous_navigation_controls_show_within_book_content() + { + $book = Book::query()->first(); + $chapter = $book->chapters->first(); + + $resp = $this->asEditor()->get($chapter->getUrl()); + $resp->assertElementContains('#sibling-navigation', 'Next'); + $resp->assertElementContains('#sibling-navigation', substr($chapter->pages[0]->name, 0, 20)); + + $resp = $this->get($chapter->pages[0]->getUrl()); + $resp->assertElementContains('#sibling-navigation', substr($chapter->pages[1]->name, 0, 20)); + $resp->assertElementContains('#sibling-navigation', 'Previous'); + $resp->assertElementContains('#sibling-navigation', substr($chapter->name, 0, 20)); + } +}