]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/CommentTest.php
Update UserPreferencesTest.php
[bookstack] / tests / Entity / CommentTest.php
index 0a71bb6eff4ab6167f70f21d9a610a6ab576829f..23fc68197411c220ccd4a173d14b11edee5aeed1 100644 (file)
@@ -152,4 +152,16 @@ 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->newUserWithRole(['name' => 'Wolfeschlegelsteinhausenbergerdorff'], ['comment-create-all', 'page-view-all']);
+        $page = $this->entities->page();
+
+        $comment = Comment::factory()->make();
+        $this->actingAs($longNamedUser)->postJson("/comment/$page->id", $comment->getAttributes());
+
+        $pageResp = $this->asAdmin()->get($page->getUrl());
+        $pageResp->assertSee('Wolfeschlegels…');
+    }
 }