-
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: convert to string from null in hs (#3136)
- Loading branch information
1 parent
4be2997
commit 75e9f46
Showing
3 changed files
with
110 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,3 +1,45 @@ | ||
import { Destination } from '../../../../../src/types'; | ||
import { generateMetadata, generateSimplifiedIdentifyPayload } from '../../../testUtils'; | ||
|
||
const commonOutputHeaders = { | ||
'Content-Type': 'application/json', | ||
Authorization: 'Bearer dummy-access-token', | ||
}; | ||
|
||
const destination: Destination = { | ||
Config: { | ||
authorizationType: 'newPrivateAppApi', | ||
accessToken: 'dummy-access-token', | ||
hubID: 'dummy-hubId', | ||
apiKey: 'dummy-apikey', | ||
apiVersion: 'newApi', | ||
lookupField: 'email', | ||
hubspotEvents: [], | ||
eventFilteringOption: 'disable', | ||
blacklistedEvents: [ | ||
{ | ||
eventName: '', | ||
}, | ||
], | ||
whitelistedEvents: [ | ||
{ | ||
eventName: '', | ||
}, | ||
], | ||
}, | ||
Enabled: true, | ||
ID: '123', | ||
Name: 'hs', | ||
DestinationDefinition: { | ||
ID: '123', | ||
Name: 'hs', | ||
DisplayName: 'Hubspot', | ||
Config: {}, | ||
}, | ||
WorkspaceID: '123', | ||
Transformations: [], | ||
}; | ||
|
||
export const data = [ | ||
{ | ||
name: 'hs', | ||
|
@@ -5269,4 +5311,66 @@ export const data = [ | |
}, | ||
}, | ||
}, | ||
{ | ||
name: 'hs', | ||
description: 'Test coversion of null to string values', | ||
feature: 'processor', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: [ | ||
{ | ||
destination, | ||
message: generateSimplifiedIdentifyPayload({ | ||
userId: '12345', | ||
context: { | ||
traits: { | ||
email: '[email protected]', | ||
firstname: null, | ||
gender: '', | ||
lookupField: 'email', | ||
}, | ||
}, | ||
}), | ||
metadata: generateMetadata(1), | ||
}, | ||
], | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: [ | ||
{ | ||
output: { | ||
version: '1', | ||
type: 'REST', | ||
userId: '', | ||
method: 'POST', | ||
endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', | ||
files: {}, | ||
headers: commonOutputHeaders, | ||
operation: 'createContacts', | ||
params: {}, | ||
body: { | ||
FORM: {}, | ||
JSON: { | ||
properties: { | ||
email: '[email protected]', | ||
firstname: '', | ||
gender: '', | ||
}, | ||
}, | ||
JSON_ARRAY: {}, | ||
XML: {}, | ||
}, | ||
}, | ||
statusCode: 200, | ||
metadata: generateMetadata(1), | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
]; |