Skip to content

Commit

Permalink
fix: review comment addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Dec 16, 2024
1 parent 8e5d6ab commit 9ce4575
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/v0/destinations/iterable/util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,30 @@ describe('iterable utils test', () => {
expect(result.errorMsg).toBe('');
});

it('should find all the matching paths it failed for and curate error message', () => {
const event = {
email: 'test',
userId: 'user123',
eventName: 'purchase',
dataFields: { customField1: 'test', customField2: 'value2' },
};
const destinationResponse = {
response: {
failCount: 1,
invalidEmails: ['test'],
failedUpdates: {
invalidEmails: ['test'],
conflictEmails: ['test'],
},
},
};
const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse);
expect(result.isAbortable).toBe(true);
expect(result.errorMsg).toBe(
'email error:"test" in "invalidEmails,failedUpdates.invalidEmails,failedUpdates.conflictEmails".',
);
});

it('should find the right value for which it should fail and passes otherwise for userIds', () => {
const event = {
email: 'test',
Expand Down

0 comments on commit 9ce4575

Please sign in to comment.