X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/0155525945bb030ae2265279dca8014c8cdcb2af..refs/pull/5280/head:/tests/Entity/CommentSettingTest.php diff --git a/tests/Entity/CommentSettingTest.php b/tests/Entity/CommentSettingTest.php index d8caa7358..7de457441 100644 --- a/tests/Entity/CommentSettingTest.php +++ b/tests/Entity/CommentSettingTest.php @@ -2,34 +2,27 @@ namespace Tests\Entity; -use BookStack\Entities\Models\Page; use Tests\TestCase; class CommentSettingTest extends TestCase { - protected $page; - - public 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(); - $this->asAdmin()->get($this->page->getUrl()) - ->assertElementNotExists('.comments-list'); + $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(); - $this->asAdmin()->get($this->page->getUrl()) - ->assertElementExists('.comments-list'); + $resp = $this->asAdmin()->get($page->getUrl()); + $this->withHtml($resp)->assertElementExists('.comments-list'); } }