mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-16 17:47:52 +00:00
Added test to cover code favourite pref. endpoint
This commit is contained in:
parent
0df5ae0658
commit
7fdc7c68b9
1 changed files with 20 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace Tests\User;
|
||||
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UserPreferencesTest extends TestCase
|
||||
|
@ -150,4 +151,23 @@ class UserPreferencesTest extends TestCase
|
|||
->assertElementExists('.featured-image-container')
|
||||
->assertElementNotExists('.content-wrap .entity-list-item');
|
||||
}
|
||||
|
||||
public function test_update_code_language_favourite()
|
||||
{
|
||||
$editor = $this->getEditor();
|
||||
$page = Page::query()->first();
|
||||
$this->actingAs($editor);
|
||||
|
||||
$this->patch('/settings/users/update-code-language-favourite', ['language' => 'php', 'active' => true]);
|
||||
$this->patch('/settings/users/update-code-language-favourite', ['language' => 'javascript', 'active' => true]);
|
||||
|
||||
$resp = $this->get($page->getUrl('/edit'));
|
||||
$resp->assertSee('option:code-editor:favourites="php,javascript"', false);
|
||||
|
||||
$this->patch('/settings/users/update-code-language-favourite', ['language' => 'ruby', 'active' => true]);
|
||||
$this->patch('/settings/users/update-code-language-favourite', ['language' => 'php', 'active' => false]);
|
||||
|
||||
$resp = $this->get($page->getUrl('/edit'));
|
||||
$resp->assertSee('option:code-editor:favourites="javascript,ruby"', false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue