From 24bc2b72f9161e9df469d528f9254cbab7918709 Mon Sep 17 00:00:00 2001 From: Emilien Chauvet Date: Tue, 11 Jul 2023 10:58:22 -0700 Subject: [PATCH] Use seed for id generation in tests (#585) * Use seed for id generation in tests * Revert "Use seed for id generation in tests" This reverts commit c5ae9ac6bfe6ddd5950247bf08cb26913ee0f1c6. * Add hardcoded ids --- .../comment/__stories__/CommentHeader.stories.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 b825b17aa..b6fa9101b 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; const mockUser = mockedUsersData[0]; const mockComment: Pick = { - 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 ?? '',