mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Removed browserkit from a couple of classess
Done a little reorganisation while there of misplaced tests. Moved MarkdownTest to a new PageEditorTest to avoid confusion with other markdown elements and to align with other page tests.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests\User;
|
||||
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UserPreferencesTest extends TestCase
|
||||
@@ -106,4 +107,44 @@ class UserPreferencesTest extends TestCase
|
||||
$home = $this->get('/login');
|
||||
$home->assertElementExists('.dark-mode');
|
||||
}
|
||||
|
||||
public function test_books_view_type_preferences_when_list()
|
||||
{
|
||||
$editor = $this->getEditor();
|
||||
setting()->putUser($editor, 'books_view_type', 'list');
|
||||
|
||||
$this->actingAs($editor)->get('/books')
|
||||
->assertElementNotExists('.featured-image-container')
|
||||
->assertElementExists('.content-wrap .entity-list-item');
|
||||
}
|
||||
|
||||
public function test_books_view_type_preferences_when_grid()
|
||||
{
|
||||
$editor = $this->getEditor();
|
||||
setting()->putUser($editor, 'books_view_type', 'grid');
|
||||
|
||||
$this->actingAs($editor)->get('/books')
|
||||
->assertElementExists('.featured-image-container');
|
||||
}
|
||||
|
||||
public function test_shelf_view_type_change()
|
||||
{
|
||||
$editor = $this->getEditor();
|
||||
/** @var Bookshelf $shelf */
|
||||
$shelf = Bookshelf::query()->first();
|
||||
setting()->putUser($editor, 'bookshelf_view_type', 'list');
|
||||
|
||||
$this->actingAs($editor)->get($shelf->getUrl())
|
||||
->assertElementNotExists('.featured-image-container')
|
||||
->assertElementExists('.content-wrap .entity-list-item')
|
||||
->assertSee('Grid View');
|
||||
|
||||
$req = $this->patch("/settings/users/{$editor->id}/switch-shelf-view", ['view_type' => 'grid']);
|
||||
$req->assertRedirect($shelf->getUrl());
|
||||
|
||||
$this->actingAs($editor)->get($shelf->getUrl())
|
||||
->assertElementExists('.featured-image-container')
|
||||
->assertElementNotExists('.content-wrap .entity-list-item')
|
||||
->assertSee('List View');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user