Skip to content

The open alternative to Salesforce, designed for AI.

Use seed for id generation in tests (#585)

Emilien Chauvet24bc2b72f916
diff --git a/front/src/modules/comments/components/comment/__stories__/CommentHeader.stories.tsx b/front/src/modules/comments/components/comment/__stories__/CommentHeader.stories.tsx
index b825b17aad1..b6fa9101b93 100644
--- a/front/src/modules/comments/components/comment/__stories__/CommentHeader.stories.tsx
+++ b/front/src/modules/comments/components/comment/__stories__/CommentHeader.stories.tsx
@@ -1,6 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { DateTime } from 'luxon';
-import { v4 } from 'uuid';
import { CommentForDrawer } from '@/comments/types/CommentForDrawer';
import { mockedUsersData } from '~/testing/mock-data/users';
@@ -20,9 +19,9 @@ type Story = StoryObj<typeof CommentHeader>;
const mockUser = mockedUsersData[0];
const mockComment: Pick<CommentForDrawer, 'id' | 'author' | 'createdAt'> = {
- id: v4(),
+ id: 'fake_comment_1_uuid',
author: {
- id: v4(),
+ id: 'fake_comment_1_author_uuid',
displayName: mockUser.displayName ?? '',
firstName: mockUser.firstName ?? '',
lastName: mockUser.lastName ?? '',
@@ -35,9 +34,9 @@ const mockCommentWithLongName: Pick<
CommentForDrawer,
'id' | 'author' | 'createdAt'
> = {
- id: v4(),
+ id: 'fake_comment_2_uuid',
author: {
- id: v4(),
+ id: 'fake_comment_2_author_uuid',
displayName: mockUser.displayName + ' with a very long suffix' ?? '',
firstName: mockUser.firstName ?? '',
lastName: mockUser.lastName ?? '',