]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/CommentSettingTest.php
Comments: Added HTML filter on load, tinymce elem filtering
[bookstack] / tests / Entity / CommentSettingTest.php
index 967e550a735e6294faf970bcfc1a605b8a57c2f7..7de4574414f4e10feb2ea7c9c53dec929c739dbb 100644 (file)
@@ -1,28 +1,28 @@
-<?php namespace Tests;
-
-class CommentSettingTest extends BrowserKitTest {
-  protected $page;
-
-  public function setUp(): void {
-      parent::setUp();
-      $this->page = \BookStack\Entities\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');
-  }
-}
\ No newline at end of file
+<?php
+
+namespace Tests\Entity;
+
+use Tests\TestCase;
+
+class CommentSettingTest extends TestCase
+{
+    public function test_comment_disable()
+    {
+        $page = $this->entities->page();
+        $this->setSettings(['app-disable-comments' => 'true']);
+        $this->asAdmin();
+
+        $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($page->getUrl());
+        $this->withHtml($resp)->assertElementExists('.comments-list');
+    }
+}