Merge branch 'Bajszi97/development' into development
This commit is contained in:
commit
709c182bda
2 changed files with 13 additions and 1 deletions
|
@ -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 a new issue