Add ability to remove profile picture on Profile Settings (#538)
* Add ability to remove profile picture on Profile Settings * Fix lint * Fix according to review
This commit is contained in:
@ -2,13 +2,15 @@ import { getOperationName } from '@apollo/client/utilities';
|
||||
import { graphql } from 'msw';
|
||||
|
||||
import { CREATE_EVENT } from '@/analytics/services';
|
||||
import { GET_CLIENT_CONFIG } from '@/client-config/queries';
|
||||
import { GET_COMPANIES } from '@/companies/services';
|
||||
import { GET_PEOPLE, UPDATE_PERSON } from '@/people/services';
|
||||
import { GET_PIPELINES } from '@/pipeline-progress/queries';
|
||||
import {
|
||||
SEARCH_COMPANY_QUERY,
|
||||
SEARCH_USER_QUERY,
|
||||
} from '@/search/services/search';
|
||||
import { GET_CURRENT_USER } from '@/users/services';
|
||||
import { GET_CURRENT_USER } from '@/users/queries';
|
||||
import {
|
||||
GetCompaniesQuery,
|
||||
GetPeopleQuery,
|
||||
@ -18,6 +20,7 @@ import {
|
||||
|
||||
import { mockedCompaniesData } from './mock-data/companies';
|
||||
import { mockedPeopleData } from './mock-data/people';
|
||||
import { mockedPipelinesData } from './mock-data/pipelines';
|
||||
import { mockedUsersData } from './mock-data/users';
|
||||
import { filterAndSortData, updateOneFromData } from './mock-data';
|
||||
|
||||
@ -103,6 +106,13 @@ export const graphqlMocks = [
|
||||
}),
|
||||
);
|
||||
}),
|
||||
graphql.query(getOperationName(GET_PIPELINES) ?? '', (req, res, ctx) => {
|
||||
return res(
|
||||
ctx.data({
|
||||
findManyPipeline: mockedPipelinesData,
|
||||
}),
|
||||
);
|
||||
}),
|
||||
graphql.mutation(getOperationName(CREATE_EVENT) ?? '', (req, res, ctx) => {
|
||||
return res(
|
||||
ctx.data({
|
||||
@ -110,4 +120,16 @@ export const graphqlMocks = [
|
||||
}),
|
||||
);
|
||||
}),
|
||||
graphql.query(getOperationName(GET_CLIENT_CONFIG) ?? '', (req, res, ctx) => {
|
||||
return res(
|
||||
ctx.data({
|
||||
clientConfig: {
|
||||
demoMode: true,
|
||||
debugMode: false,
|
||||
authProviders: { google: true, password: true, magicLink: false },
|
||||
telemetry: { enabled: false, anonymizationEnabled: true },
|
||||
},
|
||||
}),
|
||||
);
|
||||
}),
|
||||
];
|
||||
|
||||
90
front/src/testing/mock-data/pipelines.ts
Normal file
90
front/src/testing/mock-data/pipelines.ts
Normal file
@ -0,0 +1,90 @@
|
||||
import {
|
||||
Pipeline,
|
||||
PipelineProgress,
|
||||
PipelineProgressableType,
|
||||
PipelineStage,
|
||||
} from '../../generated/graphql';
|
||||
|
||||
type MockedPipeline = Pick<
|
||||
Pipeline,
|
||||
'id' | 'name' | 'pipelineProgressableType' | '__typename'
|
||||
> & {
|
||||
pipelineStages: Array<
|
||||
Pick<PipelineStage, 'id' | 'name' | 'color' | '__typename'> & {
|
||||
pipelineProgresses: Array<
|
||||
Pick<
|
||||
PipelineProgress,
|
||||
| 'id'
|
||||
| 'progressableType'
|
||||
| 'progressableId'
|
||||
| 'amount'
|
||||
| 'closeDate'
|
||||
| '__typename'
|
||||
>
|
||||
>;
|
||||
}
|
||||
>;
|
||||
};
|
||||
|
||||
export const mockedPipelinesData: Array<MockedPipeline> = [
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe3-8997-b75aa0bfb400',
|
||||
name: 'Sales pipeline',
|
||||
pipelineProgressableType: PipelineProgressableType.Company,
|
||||
pipelineStages: [
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe3-8998-b76aa0bfb600',
|
||||
name: 'New',
|
||||
color: '#B76796',
|
||||
pipelineProgresses: [
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe7-8998-b76aa0bfb600',
|
||||
progressableType: PipelineProgressableType.Company,
|
||||
progressableId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
amount: null,
|
||||
closeDate: null,
|
||||
__typename: 'PipelineProgress',
|
||||
},
|
||||
{
|
||||
id: '4a886c90-f4f2-4984-8222-882ebbb905d6',
|
||||
progressableType: PipelineProgressableType.Company,
|
||||
progressableId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
amount: null,
|
||||
closeDate: null,
|
||||
__typename: 'PipelineProgress',
|
||||
},
|
||||
],
|
||||
__typename: 'PipelineStage',
|
||||
},
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe4-8998-b76aa0bfb600',
|
||||
name: 'Screening',
|
||||
color: '#CB912F',
|
||||
pipelineProgresses: [],
|
||||
__typename: 'PipelineStage',
|
||||
},
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe5-8998-b76aa0bfb600',
|
||||
name: 'Meeting',
|
||||
color: '#9065B0',
|
||||
pipelineProgresses: [],
|
||||
__typename: 'PipelineStage',
|
||||
},
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe6-8998-b76aa0bfb600',
|
||||
name: 'Proposal',
|
||||
color: '#337EA9',
|
||||
pipelineProgresses: [],
|
||||
__typename: 'PipelineStage',
|
||||
},
|
||||
{
|
||||
id: 'fe256b39-3ec3-4fe7-8998-b76aa0bfb600',
|
||||
name: 'Customer',
|
||||
color: '#079039',
|
||||
pipelineProgresses: [],
|
||||
__typename: 'PipelineStage',
|
||||
},
|
||||
],
|
||||
__typename: 'Pipeline',
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user