Add map back to gql person

This commit is contained in:
Anders Borch
2023-04-24 23:01:15 +02:00
parent 443f8ed663
commit 4e517fa8f9

View File

@ -1,4 +1,4 @@
import { mapPerson } from './person.interface'; import { mapGqlPerson, mapPerson } from './person.interface';
describe('mapPerson', () => { describe('mapPerson', () => {
it('should map person', () => { it('should map person', () => {
@ -20,4 +20,27 @@ describe('mapPerson', () => {
}); });
expect(person.fullName).toBe('John Doe'); expect(person.fullName).toBe('John Doe');
}); });
it('should map person back', () => {
const person = mapGqlPerson({
id: 1,
fullName: 'John Doe',
email: '',
phone: '',
city: '',
company: {
id: 1,
name: '',
domain: '',
},
creationDate: new Date(),
pipe: {
id: 3,
name: '',
icon: '',
},
countryCode: '',
});
expect(person.firstname).toBe('John');
});
}); });