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
@ -1,5 +1,5 @@
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { userEvent, within } from '@storybook/test';
|
||||
import { fireEvent, userEvent, within } from '@storybook/test';
|
||||
import { HttpResponse, graphql } from 'msw';
|
||||
|
||||
import { SettingsDevelopersApiKeyDetail } from '~/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail';
|
||||
@ -50,24 +50,29 @@ export type Story = StoryObj<typeof SettingsDevelopersApiKeyDetail>;
|
||||
export const Default: Story = {
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await canvas.findByText('Settings');
|
||||
await canvas.findByText('Developers');
|
||||
await canvas.findByText('sfsfdsf API Key');
|
||||
},
|
||||
};
|
||||
|
||||
export const RegenerateApiKey: Story = {
|
||||
play: async ({ canvasElement, step }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await canvas.findByText('Settings');
|
||||
play: async ({ step }) => {
|
||||
const canvas = within(document.body);
|
||||
await canvas.findByText('sfsfdsf API Key', undefined, { timeout: 10000 });
|
||||
|
||||
// userEvent.dblClick(await canvas.findByDisplayValue('sfsfdsf'));
|
||||
|
||||
await userEvent.click(await canvas.findByText('Regenerate Key'));
|
||||
|
||||
await canvas.findByText('Cancel');
|
||||
const confirmationInput = await canvas.findByPlaceholderText('yes');
|
||||
await userEvent.click(confirmationInput);
|
||||
await userEvent.keyboard('y');
|
||||
await userEvent.keyboard('e');
|
||||
await userEvent.keyboard('s');
|
||||
|
||||
const confirmationInput = await canvas.findByTestId(
|
||||
'confirmation-modal-input',
|
||||
);
|
||||
|
||||
fireEvent.change(confirmationInput, {
|
||||
target: { value: 'yes' },
|
||||
});
|
||||
|
||||
const confirmButton = await canvas.findByTestId(
|
||||
'confirmation-modal-confirm-button',
|
||||
@ -83,16 +88,18 @@ export const RegenerateApiKey: Story = {
|
||||
export const DeleteApiKey: Story = {
|
||||
play: async ({ canvasElement, step }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await canvas.findByText('Settings');
|
||||
await canvas.findByText('sfsfdsf API Key');
|
||||
|
||||
await userEvent.click(await canvas.findByText('Delete'));
|
||||
|
||||
await canvas.findByText('Cancel');
|
||||
const confirmationInput = await canvas.findByPlaceholderText('yes');
|
||||
await userEvent.click(confirmationInput);
|
||||
await userEvent.keyboard('y');
|
||||
await userEvent.keyboard('e');
|
||||
await userEvent.keyboard('s');
|
||||
const confirmationInput = await canvas.findByTestId(
|
||||
'confirmation-modal-input',
|
||||
);
|
||||
|
||||
fireEvent.change(confirmationInput, {
|
||||
target: { value: 'yes' },
|
||||
});
|
||||
|
||||
const confirmButton = await canvas.findByTestId(
|
||||
'confirmation-modal-confirm-button',
|
||||
|
||||
Reference in New Issue
Block a user