Skip to content

Commit

Permalink
Adding testcases for comments disable / enable setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Abijeet committed Nov 16, 2017
1 parent 7a5bd23 commit 6a54733
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/Entity/CommentSettingTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php namespace Tests;

class CommentSettingTest extends BrowserKitTest {
protected $page;

public function setUp() {
parent::setUp();
$this->page = \BookStack\Page::first();
}

public function test_comment_disable () {
$this->asAdmin();

$this->setSettings(['app-disable-comments' => 'true']);

$this->asAdmin()->visit($this->page->getUrl())
->pageNotHasElement('.comments-list');
}

public function test_comment_enable () {
$this->asAdmin();

$this->setSettings(['app-disable-comments' => 'false']);

$this->asAdmin()->visit($this->page->getUrl())
->pageHasElement('.comments-list');
}
}

0 comments on commit 6a54733

Please sign in to comment.