X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1ed74b859866cda9c65b931481069bf2f3294673..refs/pull/494/head:/tests/UserProfileTest.php diff --git a/tests/UserProfileTest.php b/tests/UserProfileTest.php index 25edfbf5e..eabfce004 100644 --- a/tests/UserProfileTest.php +++ b/tests/UserProfileTest.php @@ -94,24 +94,27 @@ class UserProfileTest extends BrowserKitTest ->seePageIs('/settings/users/' . $guestUser->id) ->see('cannot delete the guest user'); } - - public function test_books_display_is_list() + + public function test_books_view_is_list() { - $this->asAdmin() - ->visit('/settings/users/' . $this->user->id) - ->select('#books_display', 'List') - ->press('Save') + $editor = $this->getEditor([ + 'books_view_type' => 'list' + ]); + + $this->actingAs($editor) ->visit('/books') + ->pageNotHasElement('.featured-image-container') ->pageHasElement('.entity-list-item'); } - public function test_books_display_is_grid() + public function test_books_view_is_grid() { - $this->asAdmin() - ->visit('/settings/users/' . $this->user->id) - ->select('#books_display', 'Grid') - ->press('Save') + $editor = $this->getEditor([ + 'books_view_type' => 'grid' + ]); + + $this->actingAs($editor) ->visit('/books') - ->pageHasElement('.gallery-item'); + ->pageHasElement('.featured-image-container'); } }