Skip to content

The open alternative to Salesforce, designed for AI.

Fix storybook tests

Charles Bochet3957658e1cc3
diff --git a/packages/twenty-front/src/testing/graphqlMocks.ts b/packages/twenty-front/src/testing/graphqlMocks.ts
index dfa741f9e19..b9269b4d137 100644
--- a/packages/twenty-front/src/testing/graphqlMocks.ts
+++ b/packages/twenty-front/src/testing/graphqlMocks.ts
@@ -113,6 +113,33 @@ export const graphqlMocks = {
},
});
}),
+ graphql.query('FindManyViews', ({ variables }) => {
+ const objectMetadataId = variables.filter?.objectMetadataId?.eq;
+ const viewType = variables.filter?.type?.eq;
+
+ return HttpResponse.json({
+ data: {
+ views: {
+ edges: mockedViewsData
+ .filter(
+ (view) =>
+ view?.objectMetadataId === objectMetadataId &&
+ view?.type === viewType,
+ )
+ .map((view) => ({
+ node: view,
+ cursor: null,
+ })),
+ pageInfo: {
+ hasNextPage: false,
+ hasPreviousPage: false,
+ startCursor: null,
+ endCursor: null,
+ },
+ },
+ },
+ });
+ }),
graphql.query('SearchWorkspaceMembers', () => {
return HttpResponse.json({
data: {
diff --git a/packages/twenty-front/src/testing/mock-data/views.ts b/packages/twenty-front/src/testing/mock-data/views.ts
index 3318e158b4f..2bb0edd27e9 100644
--- a/packages/twenty-front/src/testing/mock-data/views.ts
+++ b/packages/twenty-front/src/testing/mock-data/views.ts
@@ -25,7 +25,8 @@ export const mockedViewsData = [
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
isCompact: false,
-
+ viewFilterGroups: [],
+ viewGroups: [],
__typename: 'View',
},
{
@@ -40,6 +41,8 @@ export const mockedViewsData = [
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
isCompact: false,
+ viewFilterGroups: [],
+ viewGroups: [],
__typename: 'View',
},
{
@@ -54,6 +57,8 @@ export const mockedViewsData = [
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
isCompact: false,
+ viewFilterGroups: [],
+ viewGroups: [],
__typename: 'View',
},
{
@@ -68,6 +73,8 @@ export const mockedViewsData = [
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
isCompact: false,
+ viewFilterGroups: [],
+ viewGroups: [],
__typename: 'View',
},
];