Added test to cover code favourite pref. endpoint
This commit is contained in:
parent
0df5ae0658
commit
7fdc7c68b9
|
@ -3,6 +3,7 @@
|
||||||
namespace Tests\User;
|
namespace Tests\User;
|
||||||
|
|
||||||
use BookStack\Entities\Models\Bookshelf;
|
use BookStack\Entities\Models\Bookshelf;
|
||||||
|
use BookStack\Entities\Models\Page;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class UserPreferencesTest extends TestCase
|
class UserPreferencesTest extends TestCase
|
||||||
|
@ -150,4 +151,23 @@ class UserPreferencesTest extends TestCase
|
||||||
->assertElementExists('.featured-image-container')
|
->assertElementExists('.featured-image-container')
|
||||||
->assertElementNotExists('.content-wrap .entity-list-item');
|
->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…
Reference in New Issue