]> BookStack Code Mirror - bookstack/blob - tests/Entity/CommentSettingTest.php
Fixed some mis-refactoring and split search service
[bookstack] / tests / Entity / CommentSettingTest.php
1 <?php namespace Tests\Entity;
2
3 use BookStack\Entities\Models\Page;
4 use Tests\BrowserKitTest;
5
6 class CommentSettingTest extends BrowserKitTest
7 {
8     protected $page;
9
10     public function setUp(): void
11     {
12         parent::setUp();
13         $this->page = Page::first();
14     }
15
16     public function test_comment_disable()
17     {
18         $this->asAdmin();
19
20         $this->setSettings(['app-disable-comments' => 'true']);
21
22         $this->asAdmin()->visit($this->page->getUrl())
23             ->pageNotHasElement('.comments-list');
24     }
25
26     public function test_comment_enable()
27     {
28         $this->asAdmin();
29
30         $this->setSettings(['app-disable-comments' => 'false']);
31
32         $this->asAdmin()->visit($this->page->getUrl())
33             ->pageHasElement('.comments-list');
34     }
35 }