Skip to content

Commit

Permalink
test(documentation): add snapshot test for avatar-picture component
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschuerch committed Jul 26, 2024
1 parent a0caedb commit 4e08608
Showing 1 changed file with 50 additions and 0 deletions.
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>
`;
},
};

0 comments on commit 4e08608

Please sign in to comment.