Fix CI errored tasks for front (#6806)
In this PR: - revert de-optimization of icons bundle for storybook. This was forcing the browser to load ~3k files while running stories - adding lazy loading on Settings route to improve developer experience (some files will be loaded later) - fix FE tests: unit, modules stories, pages stories --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
committed by
Charles Bochet
parent
a3ea0acd1a
commit
56f8091a42
@ -0,0 +1,36 @@
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { expect, within } from '@storybook/test';
|
||||
|
||||
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
|
||||
|
||||
import { useKeyboardShortcutMenu } from '@/keyboard-shortcut-menu/hooks/useKeyboardShortcutMenu';
|
||||
import { useEffect } from 'react';
|
||||
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
|
||||
import { KeyboardShortcutMenu } from '../KeyboardShortcutMenu';
|
||||
|
||||
const meta: Meta<typeof KeyboardShortcutMenu> = {
|
||||
title: 'Modules/KeyboardShortcutMenu/KeyboardShortcutMenu',
|
||||
component: KeyboardShortcutMenu,
|
||||
decorators: [
|
||||
(Story) => {
|
||||
const { openKeyboardShortcutMenu } = useKeyboardShortcutMenu();
|
||||
useEffect(() => {
|
||||
openKeyboardShortcutMenu();
|
||||
}, [openKeyboardShortcutMenu]);
|
||||
return <Story />;
|
||||
},
|
||||
SnackBarDecorator,
|
||||
ComponentWithRouterDecorator,
|
||||
],
|
||||
};
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof KeyboardShortcutMenu>;
|
||||
|
||||
export const Default: Story = {
|
||||
play: async () => {
|
||||
const canvas = within(document.body);
|
||||
|
||||
expect(await canvas.findByText('Keyboard shortcuts')).toBeInTheDocument();
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user