diff --git a/src/v0/destinations/branch/utils.js b/src/v0/destinations/branch/utils.js index 007299ba0c..1415f0de39 100644 --- a/src/v0/destinations/branch/utils.js +++ b/src/v0/destinations/branch/utils.js @@ -14,8 +14,8 @@ const getMappedEventNameFromConfig = (message, destination) => { // if event is mapped on dashboard, use the mapped event name if (Array.isArray(eventsMapping) && eventsMapping.length > 0) { - const keyMap = getHashFromArray(eventsMapping, 'from', 'to'); - eventName = keyMap[event.toLowerCase()]; + const keyMap = getHashFromArray(eventsMapping, 'from', 'to', false); + eventName = keyMap[event]; } return eventName; diff --git a/src/v0/destinations/branch/utils.test.js b/src/v0/destinations/branch/utils.test.js index e108445437..e7da007d89 100644 --- a/src/v0/destinations/branch/utils.test.js +++ b/src/v0/destinations/branch/utils.test.js @@ -3,7 +3,7 @@ describe('getMappedEventNameFromConfig', () => { it('should return the mapped event name when it exists in the events mapping configuration', () => { const message = { event: 'Order Completed' }; const destination = { - Config: { eventsMapping: [{ from: 'order completed', to: 'PURCHASE' }] }, + Config: { eventsMapping: [{ from: 'Order Completed', to: 'PURCHASE' }] }, }; const result = getMappedEventNameFromConfig(message, destination); expect(result).toBe('PURCHASE'); diff --git a/test/integrations/destinations/branch/processor/data.ts b/test/integrations/destinations/branch/processor/data.ts index 89ba3b0c08..dc1bdd33bc 100644 --- a/test/integrations/destinations/branch/processor/data.ts +++ b/test/integrations/destinations/branch/processor/data.ts @@ -1561,7 +1561,7 @@ export const data = [ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, - event: 'order completed', + event: 'Order Completed', integrations: { All: true, },