-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(delighted): replace myAxios utility with handleHttpRequest utility (
- Loading branch information
1 parent
4bf65be
commit bac3cc5
Showing
3 changed files
with
159 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,18 @@ export const networkCallsData = [ | |
status: 200, | ||
}, | ||
}, | ||
{ | ||
httpReq: { | ||
url: 'https://api.delighted.com/v1/people.json', | ||
method: 'GET', | ||
headers: { Authorization: `Basic ZHVtbXlBcGlLZXlmb3JmYWlsdXJl` }, | ||
params: { | ||
email: '[email protected]', | ||
}, | ||
}, | ||
httpRes: { | ||
status: 429, | ||
data: {}, | ||
}, | ||
}, | ||
]; |
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 |
---|---|---|
|
@@ -944,4 +944,93 @@ export const data = [ | |
}, | ||
}, | ||
}, | ||
{ | ||
name: 'delighted', | ||
description: 'Too many request test', | ||
feature: 'processor', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: [ | ||
{ | ||
destination: { | ||
Config: { | ||
apiKey: 'dummyApiKeyforfailure', | ||
channel: 'email', | ||
delay: 0, | ||
eventNamesSettings: [ | ||
{ | ||
event: 'Product Reviewed', | ||
}, | ||
], | ||
}, | ||
}, | ||
message: { | ||
channel: 'web', | ||
context: { | ||
app: { | ||
build: '1.0.0', | ||
name: 'RudderLabs JavaScript SDK', | ||
namespace: 'com.rudderlabs.javascript', | ||
version: '1.0.0', | ||
}, | ||
library: { | ||
name: 'RudderLabs JavaScript SDK', | ||
version: '1.0.0', | ||
}, | ||
userAgent: | ||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', | ||
locale: 'en-US', | ||
ip: '0.0.0.0', | ||
os: { | ||
name: '', | ||
version: '', | ||
}, | ||
screen: { | ||
density: 2, | ||
}, | ||
}, | ||
messageId: '84e26acc-56a5-4835-8233-591137fca468', | ||
session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', | ||
originalTimestamp: '2019-10-14T09:03:17.562Z', | ||
type: 'track', | ||
userId: '[email protected]', | ||
event: 'Product Reviewed', | ||
properties: { | ||
review_id: '12345', | ||
product_id: '123', | ||
rating: 3, | ||
review_body: 'Average product, expected much more.', | ||
}, | ||
integrations: { | ||
All: true, | ||
}, | ||
sentAt: '2019-10-14T09:03:22.563Z', | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: [ | ||
{ | ||
error: | ||
'{"message":"Error occurred while checking user: {}","destinationResponse":{"response":{},"status":429}}', | ||
statTags: { | ||
destType: 'DELIGHTED', | ||
errorCategory: 'network', | ||
errorType: 'throttled', | ||
feature: 'processor', | ||
implementation: 'native', | ||
module: 'destination', | ||
}, | ||
statusCode: 429, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
]; |