Skip to content

Commit

Permalink
fix: review comments address
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Mar 11, 2024
1 parent eb8de80 commit 1ff8127
Show file tree
Hide file tree
Showing 5 changed files with 712 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const commonUserTraits = {
event_id: '12345',
};

// the below object has properties that are used as whitelist and blacklist properties in below test cases
const piiPropertiesForAllowDeny = {
email: '[email protected]',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
Expand All @@ -89,9 +90,10 @@ const commonTimestamp = new Date('2023-10-14');

export const configLevelFeaturesTestData: ProcessorTestData[] = [
{
id: 'facebook_pixel-test-1',
id: 'facebook_pixel-config-test-1',
name: 'facebook_pixel',
description: 'config feature : limitedDataUSage switched on',
description:
'config feature : limitedDataUSage switched on. Ref:https://developers.facebook.com/docs/marketing-apis/data-processing-options/#supported-tools-and-apis ',
scenario: 'configuration',
successCriteria: 'Response should contain limitedDataUSage related fields',
feature: 'processor',
Expand Down Expand Up @@ -130,7 +132,38 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
params: {},
FORM: {
data: [
'{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","data_processing_options":"val1","data_processing_options_country":"val2","data_processing_options_state":"val3","custom_data":{"category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}',
JSON.stringify({
user_data: {
external_id:
'3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47',
em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08',
client_user_agent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
},
event_name: 'ViewContent',
event_time: 1697241600,
event_id: '12345',
action_source: 'website',
data_processing_options: 'val1',
data_processing_options_country: 'val2',
data_processing_options_state: 'val3',
custom_data: {
category: 'dummy',
quantity: 10,
value: 100,
product_id: '12345',
content_ids: ['dummy'],
content_type: 'product_group',
contents: [
{
id: 'dummy',
quantity: 1,
},
],
content_category: 'dummy',
currency: 'USD',
},
}),
],
},
files: {},
Expand All @@ -144,11 +177,11 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
},
},
{
id: 'facebook_pixel-test-2',
id: 'facebook_pixel-config-test-2',
name: 'facebook_pixel',
scenario: 'configuration',
description:
'config feature : ContentCategoryMapping table is filled up, and category is passed with properties',
'config feature : While categoryToContent mapping is filled up in UI, but category is passed with message.properties as well. message.properties.category should be given priority over categoryToContent mapping',
successCriteria: 'Response should contain category mapped to newClothing',
feature: 'processor',
module: 'destination',
Expand Down Expand Up @@ -186,7 +219,38 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
params: {},
FORM: {
data: [
'{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","data_processing_options":"val1","data_processing_options_country":"val2","data_processing_options_state":"val3","custom_data":{"category":"clothing","quantity":10,"value":100,"product_id":"12345","content_ids":["clothing"],"content_type":"newClothing","contents":[{"id":"clothing","quantity":1}],"content_category":"clothing","currency":"USD"}}',
JSON.stringify({
user_data: {
external_id:
'3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47',
em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08',
client_user_agent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
},
event_name: 'ViewContent',
event_time: 1697241600,
event_id: '12345',
action_source: 'website',
data_processing_options: 'val1',
data_processing_options_country: 'val2',
data_processing_options_state: 'val3',
custom_data: {
category: 'clothing',
quantity: 10,
value: 100,
product_id: '12345',
content_ids: ['clothing'],
content_type: 'newClothing',
contents: [
{
id: 'clothing',
quantity: 1,
},
],
content_category: 'clothing',
currency: 'USD',
},
}),
],
},
files: {},
Expand All @@ -200,7 +264,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
},
},
{
id: 'facebook_pixel-test-3',
id: 'facebook_pixel-config-test-3',
name: 'facebook_pixel',
description:
'config feature : ContentCategoryMapping table is filled up, and category is passed with properties along with contentType via integrations object',
Expand Down Expand Up @@ -246,7 +310,35 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
params: {},
FORM: {
data: [
'{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"category":"clothing","quantity":10,"value":100,"product_id":"12345","content_ids":["clothing"],"content_type":"newClothingFromIntegrationObject","contents":[{"id":"clothing","quantity":1}],"content_category":"clothing","currency":"USD"}}',
JSON.stringify({
user_data: {
external_id:
'3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47',
em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08',
client_user_agent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
},
event_name: 'ViewContent',
event_time: 1697241600,
event_id: '12345',
action_source: 'website',
custom_data: {
category: 'clothing',
quantity: 10,
value: 100,
product_id: '12345',
content_ids: ['clothing'],
content_type: 'newClothingFromIntegrationObject',
contents: [
{
id: 'clothing',
quantity: 1,
},
],
content_category: 'clothing',
currency: 'USD',
},
}),
],
},
files: {},
Expand All @@ -260,7 +352,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
},
},
{
id: 'facebook_pixel-test-4',
id: 'facebook_pixel-config-test-4',
name: 'facebook_pixel',
description:
'config feature : Config mapped whiteList and blackListed properties with marked hashed within integrations object, along with default pii property email in the properties',
Expand Down Expand Up @@ -321,7 +413,38 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
params: {},
FORM: {
data: [
'{"user_data":{"external_id":"default-user-id","em":"[email protected]","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"val2","blacklistProp3":"val3","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}',
JSON.stringify({
user_data: {
external_id: 'default-user-id',
em: '[email protected]',
client_user_agent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
},
event_name: 'ViewContent',
event_time: 1697241600,
event_id: '12345',
action_source: 'website',
custom_data: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
whitelistProp1: 'val1',
blacklistProp2: 'val2',
blacklistProp3: 'val3',
category: 'dummy',
quantity: 10,
value: 100,
product_id: '12345',
content_ids: ['dummy'],
content_type: 'product_group',
contents: [
{
id: 'dummy',
quantity: 1,
},
],
content_category: 'dummy',
currency: 'USD',
},
}),
],
},
files: {},
Expand All @@ -335,7 +458,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
},
},
{
id: 'facebook_pixel-test-5',
id: 'facebook_pixel-config-test-5',
name: 'facebook_pixel',
description:
'config feature : Config mapped whiteList and blackListed properties without marked hashed within integrations object but marked hashed true from UI, along with default pii property email in the properties',
Expand Down Expand Up @@ -393,7 +516,41 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
params: {},
FORM: {
data: [
'{"user_data":{"external_id":"3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"528e5290f8ff0eb0325f0472b9c1a9ef4fac0b02ff6094b64d9382af4a10444b","blacklistProp3":"bac8d4414984861d5199b7a97699c728bee36c4084299b2ca905434cf65d8944","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}',
JSON.stringify({
user_data: {
external_id:
'3ffc8a075f330402d82aa0a86c596b0d2fe70df38b22c5be579f86a18e4aca47',
em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08',
client_user_agent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
},
event_name: 'ViewContent',
event_time: 1697241600,
event_id: '12345',
action_source: 'website',
custom_data: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
whitelistProp1: 'val1',
blacklistProp2:
'528e5290f8ff0eb0325f0472b9c1a9ef4fac0b02ff6094b64d9382af4a10444b',
blacklistProp3:
'bac8d4414984861d5199b7a97699c728bee36c4084299b2ca905434cf65d8944',
category: 'dummy',
quantity: 10,
value: 100,
product_id: '12345',
content_ids: ['dummy'],
content_type: 'product_group',
contents: [
{
id: 'dummy',
quantity: 1,
},
],
content_category: 'dummy',
currency: 'USD',
},
}),
],
},
files: {},
Expand All @@ -407,7 +564,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
},
},
{
id: 'facebook_pixel-test-6',
id: 'facebook_pixel-config-test-6',
name: 'facebook_pixel',
description:
'config feature : Config mapped whiteList and blackListed properties marked hashed within integrations object but marked hashed true from UI, along with default pii property email in the properties',
Expand Down Expand Up @@ -470,7 +627,38 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
params: {},
FORM: {
data: [
'{"user_data":{"external_id":"default-user-id","em":"[email protected]","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"val2","blacklistProp3":"val3","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_ids":["dummy"],"content_type":"product_group","contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}',
JSON.stringify({
user_data: {
external_id: 'default-user-id',
em: '[email protected]',
client_user_agent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
},
event_name: 'ViewContent',
event_time: 1697241600,
event_id: '12345',
action_source: 'website',
custom_data: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
whitelistProp1: 'val1',
blacklistProp2: 'val2',
blacklistProp3: 'val3',
category: 'dummy',
quantity: 10,
value: 100,
product_id: '12345',
content_ids: ['dummy'],
content_type: 'product_group',
contents: [
{
id: 'dummy',
quantity: 1,
},
],
content_category: 'dummy',
currency: 'USD',
},
}),
],
},
files: {},
Expand All @@ -484,7 +672,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
},
},
{
id: 'facebook_pixel-test-7',
id: 'facebook_pixel-config-test-7',
name: 'facebook_pixel',
description:
'properties.content_type is given priority over populating it from categoryToContent mapping.',
Expand Down Expand Up @@ -530,7 +718,39 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [
params: {},
FORM: {
data: [
'{"user_data":{"external_id":"default-user-id","em":"[email protected]","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0"},"event_name":"ViewContent","event_time":1697241600,"event_id":"12345","action_source":"website","custom_data":{"email":"[email protected]","anonymousId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","whitelistProp1":"val1","blacklistProp2":"val2","blacklistProp3":"val3","category":"dummy","quantity":10,"value":100,"product_id":"12345","content_type":"product_group","content_ids":["dummy"],"contents":[{"id":"dummy","quantity":1}],"content_category":"dummy","currency":"USD"}}',
JSON.stringify({
user_data: {
external_id: 'default-user-id',
em: '[email protected]',
client_user_agent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
},
event_name: 'ViewContent',
event_time: 1697241600,
event_id: '12345',
action_source: 'website',
custom_data: {
email: '[email protected]',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
whitelistProp1: 'val1',
blacklistProp2: 'val2',
blacklistProp3: 'val3',
category: 'dummy',
quantity: 10,
value: 100,
product_id: '12345',
content_type: 'product_group',
content_ids: ['dummy'],
contents: [
{
id: 'dummy',
quantity: 1,
},
],
content_category: 'dummy',
currency: 'USD',
},
}),
],
},
files: {},
Expand Down
Loading

0 comments on commit 1ff8127

Please sign in to comment.