1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Converted another couple of tests from browserkit

This commit is contained in:
Dan Brown
2021-05-29 23:42:21 +01:00
parent d62cdd58d3
commit 1fa90e4f12
5 changed files with 160 additions and 128 deletions

View File

@ -1,35 +1,33 @@
<?php namespace Tests\Entity;
use BookStack\Entities\Models\Page;
use Tests\BrowserKitTest;
use Tests\TestCase;
class CommentSettingTest extends BrowserKitTest
class CommentSettingTest extends TestCase
{
protected $page;
public function setUp(): void
{
parent::setUp();
$this->page = Page::first();
$this->page = Page::query()->first();
}
public function test_comment_disable()
{
$this->setSettings(['app-disable-comments' => 'true']);
$this->asAdmin();
$this->setSettings(['app-disable-comments' => 'true']);
$this->asAdmin()->visit($this->page->getUrl())
->pageNotHasElement('.comments-list');
$this->asAdmin()->get($this->page->getUrl())
->assertElementNotExists('.comments-list');
}
public function test_comment_enable()
{
$this->setSettings(['app-disable-comments' => 'false']);
$this->asAdmin();
$this->setSettings(['app-disable-comments' => 'false']);
$this->asAdmin()->visit($this->page->getUrl())
->pageHasElement('.comments-list');
$this->asAdmin()->get($this->page->getUrl())
->assertElementExists('.comments-list');
}
}