-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Worked on Braze Actions identify mapping defaults to reference proper…
…ties.braze_id (#2666) Co-authored-by: Gaurav Kochar <[email protected]>
- Loading branch information
1 parent
bb100a1
commit b0d012e
Showing
5 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,7 +569,11 @@ describe('MultiStatus', () => { | |
'@path': '$.traits.externalId' | ||
}, | ||
braze_id: { | ||
'@path': '$.traits.brazeId' | ||
'@if': { | ||
exists: { '@path': '$.integrations.Braze Cloud Mode (Actions).braze_id' }, | ||
then: { '@path': '$.integrations.Braze Cloud Mode (Actions).braze_id' }, | ||
else: { '@path': '$.traits.braze_id' } | ||
} | ||
} | ||
} | ||
|
||
|
@@ -596,6 +600,15 @@ describe('MultiStatus', () => { | |
email: '[email protected]' | ||
} | ||
}), | ||
createTestEvent({ | ||
type: 'identify', | ||
receivedAt, | ||
traits: { | ||
firstName: 'Example', | ||
lastName: 'User', | ||
braze_id: 'test-braze-id' | ||
} | ||
}), | ||
// Event without any user identifier | ||
createTestEvent({ | ||
type: 'identify', | ||
|
@@ -618,15 +631,23 @@ describe('MultiStatus', () => { | |
status: 200, | ||
body: 'success' | ||
}) | ||
|
||
// The second event doesn't fail as there is no error reported by Braze API | ||
expect(response[1]).toMatchObject({ | ||
status: 200, | ||
body: 'success' | ||
}) | ||
|
||
// The third event fails as pre-request validation fails for not having a valid user identifier | ||
// The Third event doesn't fail as there is no error reported by Braze API | ||
expect(response[2]).toMatchObject({ | ||
status: 200, | ||
body: 'success', | ||
sent: expect.objectContaining({ | ||
braze_id: 'test-braze-id' | ||
}) | ||
}) | ||
|
||
// The Fourth event fails as pre-request validation fails for not having a valid user identifier | ||
expect(response[3]).toMatchObject({ | ||
status: 400, | ||
errortype: 'PAYLOAD_VALIDATION_FAILED', | ||
errormessage: 'One of "external_id" or "user_alias" or "braze_id" or "email" is required.', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters