mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-22 12:30:27 +08:00
Merge branch 'Bajszi97/development' into development
This commit is contained in:
commit
709c182bda
|
@ -345,7 +345,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
return $splitName[0];
|
||||
}
|
||||
|
||||
return '';
|
||||
return mb_substr($this->name, 0, max($chars - 2, 0)) . '…';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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…');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user