Files
twenty/front/src/interfaces/person.interface.test.ts
T
Charles Bochet 41c46c36ed Create and EditableRelation component and make it generic (#107)
* Create and EditableRelation component and make it generic

* Refactor EditableCell component to be more flexible

* Complete Company picker on people page

* Fix lint
2023-05-06 16:08:45 +02:00

52 lines
1.2 KiB
TypeScript

import { mapGqlPerson, mapPerson } from './person.interface';
describe('mapPerson', () => {
it('should map person', () => {
const person = mapPerson({
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
firstname: 'John',
lastname: 'Doe',
email: '',
phone: '',
city: '',
created_at: '',
company: {
__typename: '',
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
name: '',
domain_name: '',
},
__typename: '',
});
expect(person.firstname).toBe('John');
});
it('should map person back', () => {
const person = mapGqlPerson({
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
firstname: 'John',
lastname: 'Doe',
email: '',
phone: '',
city: '',
company: {
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
name: 'Test',
domain_name: '',
opportunities: [],
employees: 0,
address: '',
creationDate: new Date(),
},
creationDate: new Date(),
pipe: {
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6c',
name: '',
icon: '',
},
countryCode: '',
});
expect(person.firstname).toBe('John');
});
});