From 4d0af3eb7e37a44117e6956838125456c5f8ba3e Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Wed, 16 Oct 2024 09:28:31 +0200 Subject: [PATCH] Fix tests (#7722) As per title ;) --- .../twenty-front/src/testing/graphqlMocks.ts | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/packages/twenty-front/src/testing/graphqlMocks.ts b/packages/twenty-front/src/testing/graphqlMocks.ts index a69d6c17c6..1cb7c4b3ae 100644 --- a/packages/twenty-front/src/testing/graphqlMocks.ts +++ b/packages/twenty-front/src/testing/graphqlMocks.ts @@ -62,23 +62,47 @@ export const graphqlMocks = { }); }, ), - graphql.query('FindManyViews', ({ variables }) => { - const objectMetadataId = variables.filter?.objectMetadataId?.eq; - const viewType = variables.filter?.type?.eq; - + graphql.query('SearchPeople', () => { return HttpResponse.json({ data: { - views: { - edges: mockedViewsData - .filter( - (view) => - view?.objectMetadataId === objectMetadataId && - view?.type === viewType, - ) - .map((view) => ({ - node: view, - cursor: null, - })), + searchPeople: { + edges: peopleMock.slice(0, 3).map((person) => ({ + node: person, + cursor: null, + })), + pageInfo: { + hasNextPage: false, + hasPreviousPage: false, + startCursor: null, + endCursor: null, + }, + }, + }, + }); + }), + graphql.query('SearchCompanies', () => { + return HttpResponse.json({ + data: { + searchCompanies: { + edges: companiesMock.slice(0, 3).map((company) => ({ + node: company, + cursor: null, + })), + pageInfo: { + hasNextPage: false, + hasPreviousPage: false, + startCursor: null, + endCursor: null, + }, + }, + }, + }); + }), + graphql.query('SearchOpportunities', () => { + return HttpResponse.json({ + data: { + searchOpportunities: { + edges: [], pageInfo: { hasNextPage: false, hasPreviousPage: false,