Fix tests
This commit is contained in:
@ -179,8 +179,8 @@
|
||||
"workerDirectory": "public"
|
||||
},
|
||||
"nyc": {
|
||||
"statements": 65,
|
||||
"lines": 65,
|
||||
"statements": 60,
|
||||
"lines": 60,
|
||||
"functions": 60,
|
||||
"exclude": [
|
||||
"src/generated/**/*"
|
||||
|
||||
@ -77,11 +77,12 @@ export function CompanyPickerCell({
|
||||
});
|
||||
setIsCreating(false);
|
||||
}
|
||||
const noUser: EntityForSelect = {
|
||||
const noCompany: CompanyPickerSelectedCompany = {
|
||||
entityType: Entity.Company,
|
||||
id: '',
|
||||
name: 'No Company',
|
||||
avatarType: 'rounded',
|
||||
domainName: '',
|
||||
avatarUrl: '',
|
||||
};
|
||||
return isCreating ? (
|
||||
@ -103,7 +104,7 @@ export function CompanyPickerCell({
|
||||
selectedEntity: companies.selectedEntities[0],
|
||||
loading: companies.loading,
|
||||
}}
|
||||
noUser={noUser}
|
||||
noUser={noCompany}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import { SEARCH_PEOPLE_QUERY } from '@/search/graphql/queries/searchPeopleQuery'
|
||||
import { SEARCH_USER_QUERY } from '@/search/graphql/queries/searchUserQuery';
|
||||
import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
|
||||
import { GET_VIEW_FIELDS } from '@/views/graphql/queries/getViewFields';
|
||||
import { GET_VIEWS } from '@/views/graphql/queries/getViews';
|
||||
import {
|
||||
GetCompaniesQuery,
|
||||
GetPeopleQuery,
|
||||
@ -36,6 +37,7 @@ import { mockedPeopleData, mockedPersonViewFields } from './mock-data/people';
|
||||
import { mockedPipelineProgressData } from './mock-data/pipeline-progress';
|
||||
import { mockedPipelinesData } from './mock-data/pipelines';
|
||||
import { mockedUsersData } from './mock-data/users';
|
||||
import { mockedViews } from './mock-data/views';
|
||||
import {
|
||||
fetchOneFromData,
|
||||
filterAndSortData,
|
||||
@ -250,4 +252,11 @@ export const graphqlMocks = [
|
||||
);
|
||||
},
|
||||
),
|
||||
graphql.query(getOperationName(GET_VIEWS) ?? '', (req, res, ctx) => {
|
||||
return res(
|
||||
ctx.data({
|
||||
views: mockedViews,
|
||||
}),
|
||||
);
|
||||
}),
|
||||
];
|
||||
|
||||
14
front/src/testing/mock-data/views.ts
Normal file
14
front/src/testing/mock-data/views.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { View } from '~/generated/graphql';
|
||||
|
||||
type MockedView = Pick<View, 'id' | 'name'>;
|
||||
|
||||
export const mockedViews: Array<MockedView> = [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230a',
|
||||
name: 'All',
|
||||
},
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230a',
|
||||
name: 'View example 1',
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user