mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Quick run through of applying new test entity helper class
This commit is contained in:
@ -2,34 +2,27 @@
|
||||
|
||||
namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CommentSettingTest extends TestCase
|
||||
{
|
||||
protected $page;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->page = Page::query()->first();
|
||||
}
|
||||
|
||||
public function test_comment_disable()
|
||||
{
|
||||
$page = $this->entities->page();
|
||||
$this->setSettings(['app-disable-comments' => 'true']);
|
||||
$this->asAdmin();
|
||||
|
||||
$resp = $this->asAdmin()->get($this->page->getUrl());
|
||||
$resp = $this->asAdmin()->get($page->getUrl());
|
||||
$this->withHtml($resp)->assertElementNotExists('.comments-list');
|
||||
}
|
||||
|
||||
public function test_comment_enable()
|
||||
{
|
||||
$page = $this->entities->page();
|
||||
$this->setSettings(['app-disable-comments' => 'false']);
|
||||
$this->asAdmin();
|
||||
|
||||
$resp = $this->asAdmin()->get($this->page->getUrl());
|
||||
$resp = $this->asAdmin()->get($page->getUrl());
|
||||
$this->withHtml($resp)->assertElementExists('.comments-list');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user