From: Bajszi Date: Tue, 12 Sep 2023 19:00:00 +0000 (+0200) Subject: Test comment creator name truncation X-Git-Tag: v23.10~1^2~40^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/refs/pull/4533/head?ds=inline Test comment creator name truncation --- diff --git a/tests/Entity/CommentTest.php b/tests/Entity/CommentTest.php index 0a71bb6ef..d2ed35136 100644 --- a/tests/Entity/CommentTest.php +++ b/tests/Entity/CommentTest.php @@ -152,4 +152,20 @@ class CommentTest extends TestCase $respHtml = $this->withHtml($this->get($page->getUrl('/edit'))); $respHtml->assertElementContains('.comment-box .content', 'My great comment to see in the editor'); } + + public function test_comment_creator_name_truncated() + { + $longNamedUser = $this->users->admin(); + $longNamedUser->name = 'Wolfeschlegelsteinhausenbergerdorff'; + $longNamedUser->save(); + $this->actingAs($longNamedUser); + + $page = $this->entities->page(); + + $comment = Comment::factory()->make(); + $this->postJson("/comment/$page->id", $comment->getAttributes()); + + $pageResp = $this->get($page->getUrl()); + $pageResp->assertSee('Wolfeschlegel…'); + } }