diff --git a/packages/twenty-front/src/testing/graphqlMocks.ts b/packages/twenty-front/src/testing/graphqlMocks.ts index dfa741f9e195..b9269b4d1372 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 3318e158b4f6..2bb0edd27e97 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', }, ];