-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(documentation): add snapshot test for avatar-picture component
- Loading branch information
1 parent
a0caedb
commit 4e08608
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...es/documentation/src/stories/components/avatar-picture/avatar-picture.snapshot.stories.ts
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,50 @@ | ||
import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; | ||
import meta, { Default } from './avatar-picture.stories'; | ||
import { html } from 'lit'; | ||
import { bombArgs } from '@/utils'; | ||
|
||
const { id, ...metaWithoutId } = meta; | ||
|
||
export default { | ||
...metaWithoutId, | ||
title: 'Snapshots', | ||
}; | ||
|
||
type Story = StoryObj<HTMLPostAvatarPictureElement>; | ||
|
||
export const AvatarPicture: Story = { | ||
render: (args: Args, context: StoryContext<HTMLPostAvatarPictureElement>) => { | ||
return html` | ||
<div id="Snapshots"> | ||
<h1 class="h4">Avatar</h1> | ||
${['bg-white', 'bg-dark'].map( | ||
bg => html` | ||
<div class="${bg}"> | ||
${context.argTypes.size.options.map( | ||
(size: string) => html` | ||
<div class="d-flex flex-column gap-regular p-regular mt-regular"> | ||
<h2 class="h5">size: ${size}</h2> | ||
<div class="row"> | ||
${bombArgs({ | ||
size: [size], | ||
lastname: [null, 'S'], | ||
firstname: [null, 'O'], | ||
}).map( | ||
(bombArgs: Args) => html`<div class="col"> | ||
${Default.render?.({ ...context.args, ...bombArgs }, context)} | ||
</div>`, | ||
)} | ||
<div class="col"> | ||
${Default.render?.({ ...args, size, email: '[email protected]' }, context)} | ||
</div> | ||
</div> | ||
</div> | ||
`, | ||
)} | ||
</div> | ||
`, | ||
)} | ||
</div> | ||
`; | ||
}, | ||
}; |