-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enhancements * cherry-pick 234c909 * increase size to 160 KB to bypass Size Limit error in browser-destinations * Empty Commit * Extra line break * Hide retry dropdown * Change order of tests --------- Co-authored-by: Marín Alcaraz <[email protected]>
- Loading branch information
1 parent
3ef6c21
commit 528eb6c
Showing
8 changed files
with
92 additions
and
46 deletions.
There are no files selected for viewing
8 changes: 6 additions & 2 deletions
8
packages/destination-actions/src/destinations/responsys/generated-types.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -73,36 +73,40 @@ describe('Responsys.sendAudience', () => { | |
}) | ||
|
||
describe('Failure cases', () => { | ||
it('should throw an error if audience event missing mandatory "computation_class" field', async () => { | ||
it('should throw an error if event does not include email / riid / customer_id', async () => { | ||
const errorMessage = 'At least one of the following fields is required: Email Address, RIID, or Customer ID' | ||
nock('https://njp1q7u-api.responsys.ocs.oraclecloud.com') | ||
.post( | ||
`/rest/asyncApi/v1.3/lists/${testSettings.profileListName}/listExtensions/${testSettings.profileExtensionTable}/members` | ||
) | ||
.reply(400) | ||
.replyWithError({ | ||
message: errorMessage, | ||
statusCode: 400 | ||
}) | ||
const bad_event = createTestEvent({ | ||
context: { | ||
personas: { | ||
computation_id: AUDIENCE_ID, | ||
computation_key: AUDIENCE_KEY | ||
computation_key: AUDIENCE_KEY, | ||
computation_class: 'audience' | ||
} | ||
}, | ||
timestamp: '2024-02-09T20:01:47.853Z', | ||
traits: { | ||
test_key: false, | ||
email: '[email protected]' | ||
test_key: false | ||
}, | ||
type: 'identify', | ||
userId: '6789013' | ||
type: 'identify' | ||
}) | ||
await expect( | ||
testDestination.testAction('sendAudience', { | ||
event: bad_event, | ||
useDefaultMappings: true | ||
useDefaultMappings: true, | ||
settings: testSettings | ||
}) | ||
).rejects.toThrowError("The root value is missing the required field 'computation_class'") | ||
).rejects.toThrow(errorMessage) | ||
}) | ||
|
||
it('should throw an error if audience key does not match traits object', async () => { | ||
it('should throw an error if audience event missing mandatory "computation_class" field', async () => { | ||
nock('https://njp1q7u-api.responsys.ocs.oraclecloud.com') | ||
.post( | ||
`/rest/asyncApi/v1.3/lists/${testSettings.profileListName}/listExtensions/${testSettings.profileExtensionTable}/members` | ||
|
@@ -112,8 +116,7 @@ describe('Responsys.sendAudience', () => { | |
context: { | ||
personas: { | ||
computation_id: AUDIENCE_ID, | ||
computation_key: AUDIENCE_KEY, | ||
computation_class: 'audience' | ||
computation_key: AUDIENCE_KEY | ||
} | ||
}, | ||
timestamp: '2024-02-09T20:01:47.853Z', | ||
|
@@ -129,19 +132,15 @@ describe('Responsys.sendAudience', () => { | |
event: bad_event, | ||
useDefaultMappings: true | ||
}) | ||
).rejects.toThrow() | ||
).rejects.toThrowError("The root value is missing the required field 'computation_class'") | ||
}) | ||
|
||
it('should throw an error if event does not include email / riid / customer_id', async () => { | ||
const errorMessage = 'At least one of the following fields is required: Email Address, RIID, or Customer ID' | ||
it('should throw an error if audience key does not match traits object', async () => { | ||
nock('https://njp1q7u-api.responsys.ocs.oraclecloud.com') | ||
.post( | ||
`/rest/asyncApi/v1.3/lists/${testSettings.profileListName}/listExtensions/${testSettings.profileExtensionTable}/members` | ||
) | ||
.replyWithError({ | ||
message: errorMessage, | ||
statusCode: 400 | ||
}) | ||
.reply(400) | ||
const bad_event = createTestEvent({ | ||
context: { | ||
personas: { | ||
|
@@ -152,17 +151,18 @@ describe('Responsys.sendAudience', () => { | |
}, | ||
timestamp: '2024-02-09T20:01:47.853Z', | ||
traits: { | ||
test_key: false | ||
test_key: false, | ||
email: '[email protected]' | ||
}, | ||
type: 'identify' | ||
type: 'identify', | ||
userId: '6789013' | ||
}) | ||
await expect( | ||
testDestination.testAction('sendAudience', { | ||
event: bad_event, | ||
useDefaultMappings: true, | ||
settings: testSettings | ||
useDefaultMappings: true | ||
}) | ||
).rejects.toThrow(errorMessage) | ||
).rejects.toThrow() | ||
}) | ||
}) | ||
}) |
5 changes: 3 additions & 2 deletions
5
packages/destination-actions/src/destinations/responsys/sendAudience/generated-types.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
5 changes: 3 additions & 2 deletions
5
packages/destination-actions/src/destinations/responsys/sendCustomTraits/generated-types.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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