public function test_book_sort_item_returns_book_content() { $books = \BookStack\Book::all(); $bookToSort = $books[0]; $firstPage = $bookToSort->pages[0]; $firstChapter = $bookToSort->chapters[0]; $this->asAdmin()->visit($bookToSort->getUrl() . '/sort-item')->see($bookToSort->name)->see($firstPage->name)->see($firstChapter->name); }
public function test_books_search_listing() { $book = \BookStack\Book::all()->last(); $this->asAdmin()->visit('/search/books?term=' . $book->name)->see('Book Search Results')->see('.entity-list', $book->name); }
public function testPageSearch() { $book = \BookStack\Book::all()->first(); $page = $book->pages->first(); $this->asAdmin()->visit('/')->type($page->name, 'term')->press('header-search-box-button')->see('Search Results')->see($page->name)->click($page->name)->seePageIs($page->getUrl()); }
public function test_empty_book_search_redirects_back() { $book = \BookStack\Book::all()->first(); $this->asAdmin()->visit('/books')->visit('/search/book/' . $book->id . '?term=')->seePageIs('/books'); }
public function test_popular_books() { $books = \BookStack\Book::all()->take(10); $this->asAdmin()->visit('/books')->dontSeeInElement('#popular', $books[0]->name)->dontSeeInElement('#popular', $books[1]->name)->visit($books[0]->getUrl())->visit($books[1]->getUrl())->visit($books[0]->getUrl())->visit('/books')->seeInNthElement('#popular .book', 0, $books[0]->name)->seeInNthElement('#popular .book', 1, $books[1]->name); }