Skip to content

Commit

Permalink
chore: update tests and snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed May 10, 2024
1 parent 6fd9d82 commit 8eb9720
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 16,499 deletions.
29 changes: 10 additions & 19 deletions packages/fuselage/src/components/EmailInput/EmailInput.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,18 @@ import React from 'react';

import * as stories from './EmailInput.stories';

const testCases = Object.values(composeStories(stories)).map((Story) => [
Story.storyName || 'Story',
Story,
]);
const { Default } = composeStories(stories);

describe('[EmailInput Component]', () => {
test.each(testCases)(
`renders %s without crashing`,
async (_storyname, Story) => {
const tree = render(<Story />);
expect(tree.baseElement).toMatchSnapshot();
}
);
it('renders without crashing', () => {
const tree = render(<Default />);
expect(tree.baseElement).toMatchSnapshot();
});

test.each(testCases)(
'%s should have no a11y violations',
async (_storyname, Story) => {
const { container } = render(<Story />);
it('%s should have no a11y violations', async () => {
const { container } = render(<Default />);

const results = await axe(container);
expect(results).toHaveNoViolations();
}
);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
});
Loading

0 comments on commit 8eb9720

Please sign in to comment.