-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
226 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import '@testing-library/jest-dom'; | ||
import { Badge } from '../badge/Badge'; | ||
import { Avatar } from './Avatar'; | ||
|
||
import { snapshot } from '../../test'; | ||
|
||
describe('Avatar', () => { | ||
snapshot(<Avatar />, 'default'); | ||
snapshot(<Avatar label="P" />, 'label'); | ||
snapshot(<Avatar icon="pi pi-search" />, 'icon'); | ||
snapshot(<Avatar image="user.png" />, 'image'); | ||
snapshot(<Avatar size="large" />, 'size large'); | ||
snapshot(<Avatar size="xlarge" />, 'size xlarge'); | ||
snapshot(<Avatar shape="square" />, 'shape square'); | ||
snapshot(<Avatar size="cirle" />, 'shape cirle'); | ||
snapshot(<Avatar>Content</Avatar>, 'templating'); | ||
snapshot( | ||
<Avatar image="user.png" size="xlarge"> | ||
<Badge value="4" severity="danger" /> | ||
</Avatar>, | ||
'badge' | ||
); | ||
}); |
108 changes: 108 additions & 0 deletions
108
components/lib/avatar/__snapshots__/Avatar.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Avatar badge 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component p-avatar-image p-avatar-xl" | ||
> | ||
<img | ||
alt="avatar" | ||
src="user.png" | ||
/> | ||
<span | ||
class="p-badge p-component p-badge-no-gutter p-badge-danger" | ||
> | ||
4 | ||
</span> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar default 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component" | ||
/> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar icon 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component" | ||
> | ||
<span | ||
class="p-avatar-icon pi pi-search" | ||
/> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar image 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component p-avatar-image" | ||
> | ||
<img | ||
alt="avatar" | ||
src="user.png" | ||
/> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar label 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component" | ||
> | ||
<span | ||
class="p-avatar-text" | ||
> | ||
P | ||
</span> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar shape cirle 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component" | ||
/> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar shape square 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component" | ||
/> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar size large 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component p-avatar-lg" | ||
/> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar size xlarge 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component p-avatar-xl" | ||
/> | ||
</div> | ||
`; | ||
|
||
exports[`Avatar templating 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar p-component" | ||
> | ||
Content | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import '@testing-library/jest-dom'; | ||
import { Avatar } from '../avatar/Avatar'; | ||
import { AvatarGroup } from './AvatarGroup'; | ||
|
||
import { snapshot } from '../../test'; | ||
|
||
describe('AvatarGroup', () => { | ||
snapshot(<AvatarGroup />, 'default'); | ||
snapshot( | ||
<AvatarGroup> | ||
<Avatar label="P" /> | ||
<Avatar icon="pi pi-search" /> | ||
<Avatar image="user.png" /> | ||
<Avatar label="+2" /> | ||
</AvatarGroup>, | ||
'group' | ||
); | ||
}); |
51 changes: 51 additions & 0 deletions
51
components/lib/avatargroup/__snapshots__/AvatarGroup.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AvatarGroup default 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar-group p-component" | ||
/> | ||
</div> | ||
`; | ||
|
||
exports[`AvatarGroup group 1`] = ` | ||
<div> | ||
<div | ||
class="p-avatar-group p-component" | ||
> | ||
<div | ||
class="p-avatar p-component" | ||
> | ||
<span | ||
class="p-avatar-text" | ||
> | ||
P | ||
</span> | ||
</div> | ||
<div | ||
class="p-avatar p-component" | ||
> | ||
<span | ||
class="p-avatar-icon pi pi-search" | ||
/> | ||
</div> | ||
<div | ||
class="p-avatar p-component p-avatar-image" | ||
> | ||
<img | ||
alt="avatar" | ||
src="user.png" | ||
/> | ||
</div> | ||
<div | ||
class="p-avatar p-component" | ||
> | ||
<span | ||
class="p-avatar-text" | ||
> | ||
+2 | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters