From 47f082c085ab8440b294f701b57289f101ddd1f4 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 31 Jan 2024 16:47:58 +0000 Subject: [PATCH] Comments: Added HTML filter test, fixed placeholder in dark mode --- resources/sass/_tinymce.scss | 2 +- tests/Entity/CommentTest.php | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/resources/sass/_tinymce.scss b/resources/sass/_tinymce.scss index fb5ea7e6f..b6a2156df 100644 --- a/resources/sass/_tinymce.scss +++ b/resources/sass/_tinymce.scss @@ -34,7 +34,7 @@ padding: 1rem; top: 4px; font-style: italic; - color: rgba(34,47,62,.5) + @include lightDark(color, rgba(34,47,62,.5), rgba(155,155,155,.5)) } // Default styles for our custom root nodes diff --git a/tests/Entity/CommentTest.php b/tests/Entity/CommentTest.php index eb4bccb7c..73136235c 100644 --- a/tests/Entity/CommentTest.php +++ b/tests/Entity/CommentTest.php @@ -117,6 +117,29 @@ class CommentTest extends TestCase $resp->assertDontSee('superbadonclick', false); } + public function test_comment_html_is_limited() + { + $page = $this->entities->page(); + $input = '

Test

Contenta

Hello

'; + $expected = '

Contenta

'; + + $resp = $this->asAdmin()->post("/comment/{$page->id}", ['html' => $input]); + $resp->assertOk(); + $this->assertDatabaseHas('comments', [ + 'entity_type' => 'page', + 'entity_id' => $page->id, + 'html' => $expected, + ]); + + $comment = $page->comments()->first(); + $resp = $this->put("/comment/{$comment->id}", ['html' => $input]); + $resp->assertOk(); + $this->assertDatabaseHas('comments', [ + 'id' => $comment->id, + 'html' => $expected, + ]); + } + public function test_reply_comments_are_nested() { $this->asAdmin();