Skip to content

Commit

Permalink
fix: add test-case for june to improve coverage - 2
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Sankeerth <[email protected]>
  • Loading branch information
Sai Sankeerth committed Oct 4, 2023
1 parent e5b59b6 commit aef5f42
Showing 1 changed file with 129 additions and 0 deletions.
129 changes: 129 additions & 0 deletions test/integrations/destinations/june/processor/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,4 +623,133 @@ export const data = [
},
},
},
{
name: 'june',
description: 'should fail for alias message type',
feature: 'processor',
module: 'destination',
version: 'v0',
input: {
request: {
body: [
{
destination: {
Config: {
apiKey: '93EMyDLvfpbRxxYn',
},
ID: 'june123',
},
message: {
type: 'alias',
event: 'Product Reviewed',
properties: {
review_id: '12345',
product_id: '123',
rating: 3,
review_body: 'Average product, expected much more.',
groupId: '91Yb32830',
},
context: {},
rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
originalTimestamp: '2022-01-20T13:39:21.032Z',
},
},
],
},
},
output: {
response: {
status: 200,
body: [
{
error: 'Event type "alias" is not supported',
statTags: {
destType: 'JUNE',
errorCategory: 'dataValidation',
errorType: 'instrumentation',
feature: 'processor',
implementation: 'native',
module: 'destination',
},
statusCode: 400,
},
],
},
},
},
{
name: 'june',
description: 'should transform for page event with fully populated properties',
feature: 'processor',
module: 'destination',
version: 'v0',
input: {
request: {
body: [
{
destination: {
Config: {
apiKey: '93EMyDLvfpbRxxYn',
},
ID: 'june123',
},
message: {
type: 'page',
event: 'Product Reviewed',
properties: {
review_id: '12345',
product_id: '123',
rating: 3,
review_body: 'Average product, expected much more.',
groupId: '91Yb32830',
},
context: {},
rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
originalTimestamp: '2022-01-20T13:39:21.032Z',
},
},
],
},
},
output: {
response: {
status: 200,
body: [
{
output: {
version: '1',
type: 'REST',
method: 'POST',
endpoint: 'https://api.june.so/api/page',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic 93EMyDLvfpbRxxYn',
},
params: {},
body: {
JSON: {
anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
properties: {
review_id: '12345',
product_id: '123',
rating: 3,
review_body: 'Average product, expected much more.',
},
timestamp: '2022-01-20T13:39:21.032Z',
},
JSON_ARRAY: {},
XML: {},
FORM: {},
},
files: {},
userId: '',
},
statusCode: 200,
},
],
},
},
},
];

0 comments on commit aef5f42

Please sign in to comment.