1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added testing to cover next/previous navigation

For #2511
This commit is contained in:
Dan Brown
2021-05-29 12:49:10 +01:00
parent 0cfff6ab6f
commit ed6ec341df
5 changed files with 16 additions and 4 deletions

View File

@ -31,4 +31,19 @@ class BookTest extends TestCase
$redirectReq = $this->get($deleteReq->baseResponse->headers->get('location'));
$redirectReq->assertNotificationContains('Book Successfully Deleted');
}
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', $chapter->pages[0]->name);
$resp = $this->get($chapter->pages[0]->getUrl());
$resp->assertElementContains('#sibling-navigation', $chapter->pages[1]->name);
$resp->assertElementContains('#sibling-navigation', 'Previous');
$resp->assertElementContains('#sibling-navigation', $chapter->name);
}
}