test: add tests for user-avatar

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-05-21 20:27:20 +02:00 committed by Tilman Vatteroth
parent f557901944
commit d3c133ced3
2 changed files with 145 additions and 0 deletions

View file

@ -0,0 +1,106 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`UserAvatar adds additionalClasses props to wrapping span 1`] = `
<div>
<span
class="d-inline-flex align-items-center testClass"
>
<img
alt="common.avatarOf"
class="rounded user-image"
height="20"
src="https://example.com/test.png"
title="Boaty McBoatFace"
width="20"
/>
<span
class="ml-2 mr-1 user-line-name"
>
Boaty McBoatFace
</span>
</span>
</div>
`;
exports[`UserAvatar does not show names if showName prop is false 1`] = `
<div>
<span
class="d-inline-flex align-items-center "
>
<img
alt="common.avatarOf"
class="rounded user-image"
height="20"
src="https://example.com/test.png"
title="Boaty McBoatFace"
width="20"
/>
</span>
</div>
`;
exports[`UserAvatar renders the user avatar correctly 1`] = `
<div>
<span
class="d-inline-flex align-items-center "
>
<img
alt="common.avatarOf"
class="rounded user-image"
height="20"
src="https://example.com/test.png"
title="Boaty McBoatFace"
width="20"
/>
<span
class="ml-2 mr-1 user-line-name"
>
Boaty McBoatFace
</span>
</span>
</div>
`;
exports[`UserAvatar renders the user avatar in size lg 1`] = `
<div>
<span
class="d-inline-flex align-items-center "
>
<img
alt="common.avatarOf"
class="rounded user-image"
height="30"
src="https://example.com/test.png"
title="Boaty McBoatFace"
width="30"
/>
<span
class="ml-2 mr-1 user-line-name"
>
Boaty McBoatFace
</span>
</span>
</div>
`;
exports[`UserAvatar renders the user avatar in size sm 1`] = `
<div>
<span
class="d-inline-flex align-items-center "
>
<img
alt="common.avatarOf"
class="rounded user-image"
height="16"
src="https://example.com/test.png"
title="Boaty McBoatFace"
width="16"
/>
<span
class="ml-2 mr-1 user-line-name"
>
Boaty McBoatFace
</span>
</span>
</div>
`;