Skip to content

Commit

Permalink
test: add router testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravudia committed Jan 5, 2023
1 parent 9e925bb commit 899e9d5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
51 changes: 50 additions & 1 deletion test/__tests__/data/zendesk_router_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,54 @@
"type": "group",
"userId": "abcd-124"
}
},
{
"destination": {
"Config": {
"apiToken": "yPJwcLTFSsvIkFhY23SzittHoYADJQ7eKDoxNu4x",
"createUsersAsVerified": true,
"domain": "rudderlabtest2",
"email": "[email protected]",
"removeUsersFromOrganization": false,
"sendGroupCallsWithoutUserId": false
},
"DestinationDefinition": {
"DisplayName": "Zendesk",
"ID": "1YknZ1ENqB8UurJQJE2VrEA61tr",
"Name": "ZENDESK"
},
"Enabled": true,
"ID": "1Z3zFXE6zwvNJBVOUzCuJxeO51P",
"Name": "zendesk",
"Transformations": []
},
"metadata": {
"jobId": 3
},
"message": {
"anonymousId": "223b5f40-9543-4456-a7aa-945c43048185",
"channel": "web",
"context": {
"traits": {
"country": "UK",
"name": "John Wick",
"userId": "exId-123",
"email": "testemail2@email"
},
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
},
"event": "Order completed",
"messageId": "017f5227-ead3-4b7d-9794-1465022327be",
"originalTimestamp": "2021-03-25T14:36:47.695Z",
"properties": {
"category": "category",
"label": "label",
"userId": "exId-123",
"value": "value"
},
"rudderId": "d1b1b23f-c855-4b86-bad7-091f7bbe99fe",
"type": "track",
"userId": "0000000000"
}
}
]
]
14 changes: 14 additions & 0 deletions test/__tests__/data/zendesk_router_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,19 @@
"Name": "zendesk",
"Transformations": []
}
},
{
"batched": false,
"error": "Failed to fetch user with email: testemail2@email due to Couldn't find user: John Wick",
"metadata": [
{
"jobId": 3
}
],
"statTags": {
"errorCategory": "network",
"errorType": "aborted"
},
"statusCode": 400
}
]

0 comments on commit 899e9d5

Please sign in to comment.