4 class ActivityTrackingTest extends BrowserKitTest
7 public function test_recently_viewed_books()
9 $books = \BookStack\Book::all()->take(10);
11 $this->asAdmin()->visit('/books')
12 ->dontSeeInElement('#recents', $books[0]->name)
13 ->dontSeeInElement('#recents', $books[1]->name)
14 ->visit($books[0]->getUrl())
15 ->visit($books[1]->getUrl())
17 ->seeInElement('#recents', $books[0]->name)
18 ->seeInElement('#recents', $books[1]->name);
21 public function test_popular_books()
23 $books = \BookStack\Book::all()->take(10);
25 $this->asAdmin()->visit('/books')
26 ->dontSeeInElement('#popular', $books[0]->name)
27 ->dontSeeInElement('#popular', $books[1]->name)
28 ->visit($books[0]->getUrl())
29 ->visit($books[1]->getUrl())
30 ->visit($books[0]->getUrl())
32 ->seeInNthElement('#popular .book', 0, $books[0]->name)
33 ->seeInNthElement('#popular .book', 1, $books[1]->name);