Skip to content

Commit

Permalink
chore: add snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
leagrdv committed Oct 3, 2024
1 parent 601ce27 commit 3dbd79f
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe('Form footer', () => {
it('default', () => {
cy.visit('/iframe.html?id=snapshots--form-footer');
cy.get('.form-footer post-icon', { timeout: 30000 }).should('be.visible');
cy.percySnapshot('Form footer', { widths: [320, 1440] });
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import type { StoryObj } from '@storybook/web-components';
import meta from './form-footer.stories';
import { html } from 'lit';
import { bombArgs } from '@/utils';

const { id, ...metaWithoutId } = meta;

export default {
...metaWithoutId,
title: 'Snapshots',
};

type Story = StoryObj;

export const FormFooter: Story = {
render: () => {
return html`
<div class="d-flex flex-column gap-3">
${['bg-white', 'bg-dark'].map(
bg => html`
<div class="${bg} d-flex flex-column p-3 gap-3">
${bombArgs({
leftAction: [true, false],
})
.map(
args => html`
<div class="form-footer">
${args.leftAction
? html`
<button class="btn btn-tertiary">
<post-icon aria-hidden="true" name="3024"></post-icon>Back
</button>
`
: null}
<div class="form-footer-right-actions">
<button class="btn btn-primary">
Send<post-icon aria-hidden="true" name="3020"></post-icon>
</button>
<button class="btn btn-secondary">Cancel</button>
</div>
</div>
`,
)}
</div>
`,
)}
</div>
`;
},
};
4 changes: 4 additions & 0 deletions packages/styles/src/components/form-footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ tokens.$default-map: components.$post-form-footer;
&-right-actions {
@include utility-mx.responsive-actions();
gap: tokens.get('post-form-footer', 'post-form-footer-gap');

@include media-breakpoint-up(md) {
margin-left: auto;
}
}

@include media-breakpoint-up(md) {
Expand Down

0 comments on commit 3dbd79f

Please sign in to comment.