Skip to content

Commit

Permalink
fix: reddit pixel schema to support correct connectionMode (#1428)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip authored May 30, 2024
1 parent 4e3b5fe commit ee0a5c9
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/configurations/destinations/reddit_pixel/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"connectionMode": {
"type": "object",
"properties": {
"web": { "type": "string", "enum": ["web"] }
"web": { "type": "string", "enum": ["device"] }
}
},
"eventFilteringOption": {
Expand Down
80 changes: 80 additions & 0 deletions test/data/validation/destinations/reddit_pixel.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
{ "to": "Search", "from": "Search" },
{ "to": "SignUp", "from": "SignUp" }
],
"connectionMode": {
"web": "device"
},
"whitelistedEvents": [],
"blacklistedEvents": [],
"oneTrustCookieCategories": []
Expand All @@ -104,6 +107,9 @@
"resolutionStrategy": "nor"
}
]
},
"connectionMode": {
"web": "device"
}
},
"result": false,
Expand Down Expand Up @@ -158,5 +164,79 @@
},
"result": false,
"err": ["consentManagement.web.0.provider must be equal to one of the allowed values"]
},
{
"testTitle": "With invalid connectionMode",
"config": {
"eventFilteringOption": "disable",
"advertiserId": "01234567890123456789012345678901234567890123456789",
"whitelistedEvents": [],
"blacklistedEvents": [],
"oneTrustCookieCategories": [],
"connectionMode": {
"web": "cloud"
}
},
"result": false,
"err": ["connectionMode.web must be equal to one of the allowed values"]
},
{
"testTitle": "check with all possible event names",
"config": {
"advertiserId": "12345",
"eventFilteringOption": "disable",
"eventMappingFromConfig": [
{
"from": "123123",
"to": "AddToCart"
},
{
"to": "AddToWishlist",
"from": "1"
},
{
"to": "Purchase",
"from": "2"
},
{
"to": "Lead",
"from": "3"
},
{
"to": "ViewContent",
"from": "4"
},
{
"to": "Search",
"from": "5"
},
{
"to": "SignUp",
"from": "6"
},
{
"to": "AddToWishlist",
"from": "6"
}
],
"whitelistedEvents": [],
"blacklistedEvents": [],
"useNativeSDK": {
"web": true
},
"connectionMode": {
"web": "device"
},
"consentManagement": {
"web": [
{
"provider": "oneTrust",
"resolutionStrategy": "",
"consents": []
}
]
}
},
"result": true
}
]

0 comments on commit ee0a5c9

Please sign in to comment.