+ public function test_toggle_book_view()
+ {
+ $editor = $this->getEditor();
+ setting()->putUser($editor, 'books_view_type', 'grid');
+
+ $this->actingAs($editor)
+ ->visit('/books')
+ ->pageHasElement('.featured-image-container')
+ ->submitForm('Toggle Book View')
+ // Check redirection.
+ ->seePageIs('/books')
+ ->pageNotHasElement('.featured-image-container');
+
+ $this->actingAs($editor)
+ ->visit('/books')
+ ->submitForm('Toggle Book View')
+ ->seePageIs('/books')
+ ->pageHasElement('.featured-image-container');
+
+ }
+