Fix and enhance storybook:pages tests (#3085)
* Fix and enhance storybook:pages tests Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com> * Fix and enhance storybook:pages tests Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com> * fix SettingsObjectFieldPreview Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com> * Fix lint Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com> * Fix jest Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com> * Add more fixes Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com> * Fix App.stories.tsx Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com> * Fix tests * Fix according to review --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -18,9 +18,11 @@ type MockedActivity = Pick<
|
||||
| 'authorId'
|
||||
| 'dueAt'
|
||||
| 'completedAt'
|
||||
| 'reminderAt'
|
||||
| 'assigneeId'
|
||||
> & {
|
||||
author: Pick<WorkspaceMember, 'id' | 'name' | 'avatarUrl'>;
|
||||
assignee: Pick<WorkspaceMember, 'id' | 'name' | 'avatarUrl'>;
|
||||
author: WorkspaceMember;
|
||||
assignee: WorkspaceMember;
|
||||
comments: Comment[];
|
||||
activityTargets: Array<
|
||||
Pick<
|
||||
@ -40,33 +42,35 @@ type MockedActivity = Pick<
|
||||
>;
|
||||
};
|
||||
|
||||
const workspaceMember: WorkspaceMember = {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
locale: 'en',
|
||||
createdAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
userId: 'e2409670-1088-46b4-858e-f20a598d9d0f',
|
||||
colorScheme: 'Light',
|
||||
};
|
||||
|
||||
export const mockedTasks: Array<MockedActivity> = [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
id: 'c554852c-b28a-4307-a41d-a7a0fdde3386',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
reminderAt: null,
|
||||
title: 'My very first task',
|
||||
type: 'Task',
|
||||
body: '',
|
||||
dueAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
completedAt: null,
|
||||
author: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
assignee: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
author: workspaceMember,
|
||||
assignee: workspaceMember,
|
||||
assigneeId: workspaceMember.id,
|
||||
authorId: workspaceMember.id,
|
||||
comments: [],
|
||||
activityTargets: [],
|
||||
__typename: 'Activity',
|
||||
@ -75,31 +79,19 @@ export const mockedTasks: Array<MockedActivity> = [
|
||||
|
||||
export const mockedActivities: Array<MockedActivity> = [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
id: '3ecaa1be-aac7-463a-a38e-64078dd451d5',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
reminderAt: null,
|
||||
title: 'My very first note',
|
||||
type: 'Note',
|
||||
body: '',
|
||||
dueAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
completedAt: null,
|
||||
author: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
assignee: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
author: workspaceMember,
|
||||
assignee: workspaceMember,
|
||||
assigneeId: workspaceMember.id,
|
||||
authorId: workspaceMember.id,
|
||||
comments: [],
|
||||
activityTargets: [
|
||||
{
|
||||
@ -149,28 +141,19 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
reminderAt: null,
|
||||
title: 'Another note',
|
||||
body: '',
|
||||
type: 'Note',
|
||||
completedAt: null,
|
||||
dueAt: '2029-08-26T10:12:42.33625+00:00',
|
||||
author: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
...workspaceMember,
|
||||
colorScheme: 'Dark',
|
||||
},
|
||||
assignee: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
assignee: { ...workspaceMember, colorScheme: 'Dark' },
|
||||
assigneeId: workspaceMember.id,
|
||||
authorId: workspaceMember.id,
|
||||
comments: [],
|
||||
activityTargets: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user