]> BookStack Code Mirror - bookstack/commitdiff
Test comment creator name truncation 4533/head
authorBajszi <redacted>
Tue, 12 Sep 2023 19:00:00 +0000 (21:00 +0200)
committerBajszi <redacted>
Tue, 12 Sep 2023 19:10:25 +0000 (21:10 +0200)
tests/Entity/CommentTest.php

index 0a71bb6eff4ab6167f70f21d9a610a6ab576829f..d2ed3513679350e5ff85e4a1f918e04c33251255 100644 (file)
@@ -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');
     }
         $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…');
+    }
 }
 }