Fix storybook / chromatic tests flakyness and integration tests (#11687)

## Storybook flakyness

### Actor Display image flakyness

<img width="1512" alt="image"
src="https://github.com/user-attachments/assets/875c0738-5e31-4aba-9231-4ba5f78d1355"
/>

**Fix:** stop using a random usage

### Task Groups broken

<img width="1512" alt="image"
src="https://github.com/user-attachments/assets/c67e47a1-a027-43f1-9601-68d61a8052b4"
/>

**Fix:** add missing TabListComponentInstance

## Flaky dates

Add https://github.com/k35o/storybook-addon-mock-date

## Integration tests

Fix broken tests due to relation refactoring
This commit is contained in:
Charles Bochet
2025-04-23 01:57:36 +02:00
committed by GitHub
parent 8694840b92
commit fa5f758228
20 changed files with 153 additions and 155 deletions

View File

@ -9,8 +9,6 @@ import { graphqlMocks } from '~/testing/graphqlMocks';
import { userEvent, within } from '@storybook/test';
import { SettingsExperience } from '../profile/appearance/components/SettingsExperience';
Date.now = () => new Date('2022-06-13T12:33:37.000Z').getTime();
const meta: Meta<PageDecoratorArgs> = {
title: 'Pages/Settings/SettingsExperience',
component: SettingsExperience,
@ -44,15 +42,15 @@ export const DateTimeSettingsTimeFormat: Story = {
await canvas.findByText('Date and time');
const timeFormatSelect = await canvas.findByText('24h (08:33)');
const timeFormatSelect = await canvas.findByText('24h (05:30)');
await userEvent.click(timeFormatSelect);
const timeFormatOptions = await canvas.findByText('12h (8:33 AM)');
const timeFormatOptions = await canvas.findByText('12h (5:30 AM)');
await userEvent.click(timeFormatOptions);
await canvas.findByText('12h (8:33 AM)');
await canvas.findByText('12h (5:30 AM)');
},
};
@ -84,14 +82,14 @@ export const DateTimeSettingsDateFormat: Story = {
await canvas.findByText('Date and time');
const timeFormatSelect = await canvas.findByText('13 Jun, 2022');
const timeFormatSelect = await canvas.findByText('12 Mar, 2024');
await userEvent.click(timeFormatSelect);
const timeFormatOptions = await canvas.findByText('Jun 13, 2022');
const timeFormatOptions = await canvas.findByText('Mar 12, 2024');
await userEvent.click(timeFormatOptions);
await canvas.findByText('Jun 13, 2022');
await canvas.findByText('Mar 12, 2024');
},
};