29bd74feea
## Done - add `EMAILS`, `PHONES`, `LINKS`, `RICH_TEXT`, `POSITION`, and `ARRAY` field support in Twenty zapier integration - fix `twenty-zapier` package tests and requirements ## Emails <img width="791" alt="image" src="https://github.com/user-attachments/assets/7987a1a2-6076-4715-9221-d4a1898b7634"> ## Links <img width="797" alt="image" src="https://github.com/user-attachments/assets/b94ce972-fae2-4953-b9e8-79c0478f5f60"> ## Phones <img width="789" alt="image" src="https://github.com/user-attachments/assets/7234eaaf-40b8-4772-8880-c58ba47618c5"> ## Array <img width="834" alt="image" src="https://github.com/user-attachments/assets/99cb6795-e428-40ea-9c3a-d52561c2c6e1">
53 lines
2.1 KiB
TypeScript
53 lines
2.1 KiB
TypeScript
import handleQueryParams from '../../utils/handleQueryParams';
|
|
|
|
describe('utils.handleQueryParams', () => {
|
|
test('should handle empty values', () => {
|
|
const inputData = {};
|
|
const result = handleQueryParams(inputData);
|
|
const expectedResult = '';
|
|
expect(result).toEqual(expectedResult);
|
|
});
|
|
test('should format', () => {
|
|
const inputData = {
|
|
name: 'Company Name',
|
|
address: { addressCity: 'Paris' },
|
|
domainName: 'Company Domain Name',
|
|
linkedinUrl__url: '/linkedin_url',
|
|
linkedinUrl__label: 'Test linkedinUrl',
|
|
whatsapp__primaryLinkUrl: '/whatsapp_url',
|
|
whatsapp__primaryLinkLabel: 'Whatsapp Link',
|
|
whatsapp__secondaryLinks: [
|
|
"{url: '/secondary_whatsapp_url',label: 'Secondary Whatsapp Link'}",
|
|
],
|
|
emails: {
|
|
primaryEmail: 'primary@email.com',
|
|
additionalEmails: ['secondary@email.com'],
|
|
},
|
|
phones: {
|
|
primaryPhoneNumber: '322110011',
|
|
primaryPhoneCountryCode: '+33',
|
|
additionalPhones: ["{ phoneNumber: '322110012', countryCode: '+33' }"],
|
|
},
|
|
xUrl__url: '/x_url',
|
|
xUrl__label: 'Test xUrl',
|
|
annualRecurringRevenue: 100000,
|
|
idealCustomerProfile: true,
|
|
employees: 25,
|
|
};
|
|
const result = handleQueryParams(inputData);
|
|
const expectedResult =
|
|
'name: "Company Name", ' +
|
|
'address: {addressCity: "Paris"}, ' +
|
|
'domainName: "Company Domain Name", ' +
|
|
'linkedinUrl: {url: "/linkedin_url", label: "Test linkedinUrl"}, ' +
|
|
'whatsapp: {primaryLinkUrl: "/whatsapp_url", primaryLinkLabel: "Whatsapp Link", secondaryLinks: [{url: \'/secondary_whatsapp_url\',label: \'Secondary Whatsapp Link\'}]}, ' +
|
|
'emails: {primaryEmail: "primary@email.com", additionalEmails: ["secondary@email.com"]}, ' +
|
|
'phones: {primaryPhoneNumber: "322110011", primaryPhoneCountryCode: "+33", additionalPhones: [{ phoneNumber: \'322110012\', countryCode: \'+33\' }]}, ' +
|
|
'xUrl: {url: "/x_url", label: "Test xUrl"}, ' +
|
|
'annualRecurringRevenue: 100000, ' +
|
|
'idealCustomerProfile: true, ' +
|
|
'employees: 25';
|
|
expect(result).toEqual(expectedResult);
|
|
});
|
|
});
|