From 78ce4e276ffd001cfc492a15acfea26c70d04ff4 Mon Sep 17 00:00:00 2001 From: AASHISH MALIK Date: Fri, 9 Jun 2023 17:36:07 +0530 Subject: [PATCH] chore: increase test converage (#2254) chore: increase test converage --- test/__tests__/data/braze_input.json | 136 ++++++++++++++++++++++++++ test/__tests__/data/braze_output.json | 52 ++++++++++ 2 files changed, 188 insertions(+) diff --git a/test/__tests__/data/braze_input.json b/test/__tests__/data/braze_input.json index 0de3571b36..492ae7fdf5 100644 --- a/test/__tests__/data/braze_input.json +++ b/test/__tests__/data/braze_input.json @@ -1610,5 +1610,141 @@ "type": "track", "userId": "" } + }, + { + "message": { + "type": "group", + "event": "Order Completed", + "sentAt": "2020-09-14T12:09:37.491Z", + "userId": "Randomuser2222", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.3", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "file:///Users/manashi/Desktop/rudder-all-sdk-application-testing/Fullstory%20test%20By%20JS%20SDK/braze.html", + "path": "/Users/manashi/Desktop/rudder-all-sdk-application-testing/Fullstory%20test%20By%20JS%20SDK/braze.html", + "title": "Fullstory Test", + "search": "", + "referrer": "" + }, + "locale": "en-GB", + "screen": { + "density": 2 + }, + "traits": { + "email": "manashi@gmaiol.com" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.3" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36" + }, + "messageId": "24ecc509-ce3e-473c-8483-ba1ea2c195cb", + "groupId": "1234", + "traits": { + "phone": "5055077683", + "subscriptionState": "subscribed" + }, + "anonymousId": "c6ff1462-b692-43d6-8f6a-659efedc99ea", + "integrations": { + "All": true + }, + "originalTimestamp": "2020-09-14T12:09:37.491Z" + }, + "destination": { + "Config": { + "restApiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", + "prefixProperties": true, + "useNativeSDK": false, + "enableSubscriptionGroupInGroupCall": true + }, + "DestinationDefinition": { + "DisplayName": "Braze", + "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", + "Name": "BRAZE" + }, + "Enabled": true, + "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", + "Name": "Braze", + "Transformations": [] + } + }, + { + "message": { + "type": "group", + "event": "Order Completed", + "sentAt": "2020-09-14T12:09:37.491Z", + "userId": "Randomuser2222", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.1.3", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "file:///Users/manashi/Desktop/rudder-all-sdk-application-testing/Fullstory%20test%20By%20JS%20SDK/braze.html", + "path": "/Users/manashi/Desktop/rudder-all-sdk-application-testing/Fullstory%20test%20By%20JS%20SDK/braze.html", + "title": "Fullstory Test", + "search": "", + "referrer": "" + }, + "locale": "en-GB", + "screen": { + "density": 2 + }, + "traits": { + "email": "manashi@gmaiol.com" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.3" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36" + }, + "messageId": "24ecc509-ce3e-473c-8483-ba1ea2c195cb", + "groupId": "1234", + "traits": { + "email": "abc@test.com", + "subscriptionState": "unsubscribed" + }, + "anonymousId": "c6ff1462-b692-43d6-8f6a-659efedc99ea", + "integrations": { + "All": true + }, + "originalTimestamp": "2020-09-14T12:09:37.491Z" + }, + "destination": { + "Config": { + "restApiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", + "prefixProperties": true, + "useNativeSDK": false, + "enableSubscriptionGroupInGroupCall": true + }, + "DestinationDefinition": { + "DisplayName": "Braze", + "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", + "Name": "BRAZE" + }, + "Enabled": true, + "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", + "Name": "Braze", + "Transformations": [] + } } ] diff --git a/test/__tests__/data/braze_output.json b/test/__tests__/data/braze_output.json index 5d3f679e47..44b61a599b 100644 --- a/test/__tests__/data/braze_output.json +++ b/test/__tests__/data/braze_output.json @@ -874,5 +874,57 @@ }, "files": {}, "userId": "e6ab2c5e-1cda-34a9-g962-r2f62df18abc" + }, + { + "body": { + "FORM": {}, + "JSON": { + "external_id": [ + "Randomuser2222" + ], + "phone": "5055077683", + "subscription_group_id": "1234", + "subscription_state": "subscribed" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "endpoint": "https://rest.fra-01.braze.eu/subscription/status/set", + "files": {}, + "headers": { + "Accept": "application/json", + "Authorization": "Bearer 9432f11f70f8ce386f5110c8c924b3ec4f825256", + "Content-Type": "application/json" + }, + "method": "POST", + "params": {}, + "type": "REST", + "version": "1" + }, + { + "body": { + "FORM": {}, + "JSON": { + "external_id": [ + "Randomuser2222" + ], + "email": "abc@test.com", + "subscription_group_id": "1234", + "subscription_state": "unsubscribed" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "endpoint": "https://rest.fra-01.braze.eu/subscription/status/set", + "files": {}, + "headers": { + "Accept": "application/json", + "Authorization": "Bearer 9432f11f70f8ce386f5110c8c924b3ec4f825256", + "Content-Type": "application/json" + }, + "method": "POST", + "params": {}, + "type": "REST", + "version": "1" } ]