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
This commit is contained in:
@ -1,6 +1,5 @@
|
|||||||
import type { Meta, StoryObj } from '@storybook/react';
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import { v4 } from 'uuid';
|
|
||||||
|
|
||||||
import { CommentForDrawer } from '@/comments/types/CommentForDrawer';
|
import { CommentForDrawer } from '@/comments/types/CommentForDrawer';
|
||||||
import { mockedUsersData } from '~/testing/mock-data/users';
|
import { mockedUsersData } from '~/testing/mock-data/users';
|
||||||
@ -20,9 +19,9 @@ type Story = StoryObj<typeof CommentHeader>;
|
|||||||
const mockUser = mockedUsersData[0];
|
const mockUser = mockedUsersData[0];
|
||||||
|
|
||||||
const mockComment: Pick<CommentForDrawer, 'id' | 'author' | 'createdAt'> = {
|
const mockComment: Pick<CommentForDrawer, 'id' | 'author' | 'createdAt'> = {
|
||||||
id: v4(),
|
id: 'fake_comment_1_uuid',
|
||||||
author: {
|
author: {
|
||||||
id: v4(),
|
id: 'fake_comment_1_author_uuid',
|
||||||
displayName: mockUser.displayName ?? '',
|
displayName: mockUser.displayName ?? '',
|
||||||
firstName: mockUser.firstName ?? '',
|
firstName: mockUser.firstName ?? '',
|
||||||
lastName: mockUser.lastName ?? '',
|
lastName: mockUser.lastName ?? '',
|
||||||
@ -35,9 +34,9 @@ const mockCommentWithLongName: Pick<
|
|||||||
CommentForDrawer,
|
CommentForDrawer,
|
||||||
'id' | 'author' | 'createdAt'
|
'id' | 'author' | 'createdAt'
|
||||||
> = {
|
> = {
|
||||||
id: v4(),
|
id: 'fake_comment_2_uuid',
|
||||||
author: {
|
author: {
|
||||||
id: v4(),
|
id: 'fake_comment_2_author_uuid',
|
||||||
displayName: mockUser.displayName + ' with a very long suffix' ?? '',
|
displayName: mockUser.displayName + ' with a very long suffix' ?? '',
|
||||||
firstName: mockUser.firstName ?? '',
|
firstName: mockUser.firstName ?? '',
|
||||||
lastName: mockUser.lastName ?? '',
|
lastName: mockUser.lastName ?? '',
|
||||||
|
|||||||
Reference in New Issue
Block a user