Skip to content

Commit

Permalink
Refactor Storybook preview to remove LiveLog and update heading role …
Browse files Browse the repository at this point in the history
…query in Case Launcher demo test
  • Loading branch information
ricmars committed Feb 17, 2025
1 parent d423414 commit a6bb440
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import {
Aries2023Theme,
Aries2023DarkTheme,
ThemeMachine,
BaseThemeMachine,
LiveLog
BaseThemeMachine
} from '@pega/cosmos-react-core';
import type { DefaultSettableTheme, DefaultThemeDefinition } from '@pega/cosmos-react-core';
import * as MantisTheme from './MantisTheme.json';
Expand Down Expand Up @@ -77,15 +76,13 @@ const preview: Preview = {
disableDefaultFontLoading
id='Preview'
>
<LiveLog maxLength={50}>
<PopoverManager>
<Toaster dismissAfter={5000}>
<ModalManager>
<Story {...context} />
</ModalManager>
</Toaster>
</PopoverManager>
</LiveLog>
<PopoverManager>
<Toaster dismissAfter={5000}>
<ModalManager>
<Story {...context} />
</ModalManager>
</Toaster>
</PopoverManager>
</Configuration>
);
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pega_Extensions_CaseLauncher/demo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('renders Case Launcher widget with default args', () => {
jest.spyOn(window, 'alert').mockImplementation(() => {});
render(<Default />);

const headingElement = screen.getByRole('heading', { name: /start case/i });
const headingElement = screen.getByRole('heading');
expect(headingElement).not.toBeNull();

const buttonElement = screen.getByRole('button', { name: 'Start a case' });
Expand Down

0 comments on commit a6bb440

Please sign in to comment.