X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/832f8eaa9492c27aec2d2e058d36c3fc4f9122fa..refs/pull/494/head:/tests/UserProfileTest.php diff --git a/tests/UserProfileTest.php b/tests/UserProfileTest.php index 09870e138..eabfce004 100644 --- a/tests/UserProfileTest.php +++ b/tests/UserProfileTest.php @@ -95,23 +95,26 @@ class UserProfileTest extends BrowserKitTest ->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('grid', '#books_display') - ->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('list', '#books_display') - ->press('Save') + $editor = $this->getEditor([ + 'books_view_type' => 'grid' + ]); + + $this->actingAs($editor) ->visit('/books') - ->pageHasElement('.gallery-item'); + ->pageHasElement('.featured-image-container'); } }