]> BookStack Code Mirror - bookstack/blobdiff - tests/UserProfileTest.php
Added migration file.
[bookstack] / tests / UserProfileTest.php
index 728422810459c691c78f4acfc9ef18f9454eeb70..eabfce00409ea5c569c44634a5989d8fa94e395d 100644 (file)
@@ -95,25 +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('.gallery-item')
+            ->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')
-            ->pageNotHasElement('.entity-list-item')
-            ->pageHasElement('.gallery-item');
+            ->pageHasElement('.featured-image-container');
     }
 }