From 83028f3fbea8ead701b604d161100923545fcb53 Mon Sep 17 00:00:00 2001 From: Bajszi Date: Tue, 12 Sep 2023 21:00:00 +0200 Subject: [PATCH] Test comment creator name truncation --- tests/Entity/CommentTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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…'); + } }