From a13f6e498d30d57ce202d6b8a84aa4df25c627aa Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Thu, 15 Aug 2024 15:49:30 -0300 Subject: [PATCH] tests: fix SideBar V2 tests --- .../src/components/SideBarV2/SideBar.spec.tsx | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/packages/fuselage/src/components/SideBarV2/SideBar.spec.tsx b/packages/fuselage/src/components/SideBarV2/SideBar.spec.tsx index 5299406c6b..d125962e2a 100644 --- a/packages/fuselage/src/components/SideBarV2/SideBar.spec.tsx +++ b/packages/fuselage/src/components/SideBarV2/SideBar.spec.tsx @@ -1,26 +1,19 @@ import { composeStories } from '@storybook/react'; -import { render } from '@testing-library/react'; import { axe } from 'jest-axe'; +import { render } from '../../testing'; import * as stories from './SideBar.stories'; -const testCases = Object.values(composeStories(stories)); +const { Default } = composeStories(stories); -describe('[SideBar Component]', () => { - test.each(testCases)( - `renders %s without crashing`, - async (_storyname, Story) => { - render(); - } - ); +describe('[Sidebar Component]', () => { + it('renders without crashing', () => { + render(); + }); + it('should have no a11y violations', async () => { + const { container } = render(); - test.each(testCases)( - '%s should have no a11y violations', - async (_storyname, Story) => { - const { container } = render(); - - const results = await axe(container); - expect(results).toHaveNoViolations(); - } - ); + const results = await axe(container); + expect(results).toHaveNoViolations(); + }); });