diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts index a4122a6887..9ac709978d 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts @@ -255,84 +255,4 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ }, }, }, - { - id: 'facebook_pixel_v1_scenario_7', - name: 'facebook_pixel', - description: 'app event fails due to missing permissions', - successCriteria: 'Should return 400 with missing permissions error', - scenario: 'Business', - feature: 'dataDelivery', - module: 'destination', - version: 'v1', - input: { - request: { - body: generateProxyV1Payload({ - endpoint: `https://graph.facebook.com/${VERSION}/1234567891234571/events?access_token=valid_access_token`, - FORM: testFormData, - }), - method: 'POST', - }, - }, - output: { - response: { - status: 200, - body: { - output: { - status: 400, - message: 'Capability or permissions issue.', - statTags, - response: [ - { - error: 'Capability or permissions issue.', - statusCode: 400, - metadata: generateMetadata(1), - }, - ], - }, - }, - }, - }, - }, - { - id: 'facebook_pixel_v1_scenario_8', - name: 'facebook_pixel', - description: 'app event fails due to Unhandled random error', - successCriteria: 'Should return 500 with Unhandled random error', - scenario: 'Business', - feature: 'dataDelivery', - module: 'destination', - version: 'v1', - input: { - request: { - body: generateProxyV1Payload({ - endpoint: `https://graph.facebook.com/${VERSION}/1234567891234572/events?access_token=valid_access_token_unhandled_response`, - FORM: testFormData, - }), - method: 'POST', - }, - }, - output: { - response: { - status: 200, - body: { - output: { - status: 500, - message: 'Unhandled random error', - statTags: { - ...statTags, - errorType: 'retryable', - meta: 'unhandledStatusCode', - }, - response: [ - { - error: 'Unhandled random error', - statusCode: 500, - metadata: generateMetadata(1), - }, - ], - }, - }, - }, - }, - }, ]; diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts index 62d07afdd7..dcc633e1a8 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts @@ -1,6 +1,7 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; import { testScenariosForV1API, testFormData, statTags as baseStatTags } from './business'; import { otherScenariosV1 } from './other'; +import { oauthScenariosV1 } from './oauth'; const statTags = { ...baseStatTags, @@ -488,4 +489,9 @@ export const v0TestData = [ }, ]; -export const data = [...v0TestData, ...testScenariosForV1API, ...otherScenariosV1]; +export const data = [ + ...v0TestData, + ...testScenariosForV1API, + ...otherScenariosV1, + ...oauthScenariosV1, +]; diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/oauth.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/oauth.ts new file mode 100644 index 0000000000..c6d938c627 --- /dev/null +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/oauth.ts @@ -0,0 +1,45 @@ +import { testFormData, statTags } from './business'; +import { generateProxyV1Payload, generateMetadata } from '../../../testUtils'; +import { ProxyV1TestData } from '../../../testTypes'; +import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; + +export const oauthScenariosV1: ProxyV1TestData[] = [ + { + id: 'facebook_pixel_v1_oauth_scenario_1', + name: 'facebook_pixel', + description: 'app event fails due to missing permissions', + successCriteria: 'Should return 400 with missing permissions error', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload({ + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234571/events?access_token=valid_access_token`, + FORM: testFormData, + }), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + message: 'Capability or permissions issue.', + statTags, + response: [ + { + error: 'Capability or permissions issue.', + statusCode: 400, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts index c9be09e7b7..e25cc8e07c 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts @@ -48,4 +48,46 @@ export const otherScenariosV1: ProxyV1TestData[] = [ }, }, }, + { + id: 'facebook_pixel_v1_other_scenario_2', + name: 'facebook_pixel', + description: 'app event fails due to Unhandled random error', + successCriteria: 'Should return 500 with Unhandled random error', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload({ + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234572/events?access_token=valid_access_token_unhandled_response`, + FORM: testFormData, + }), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 500, + message: 'Unhandled random error', + statTags: { + ...statTags, + errorType: 'retryable', + meta: 'unhandledStatusCode', + }, + response: [ + { + error: 'Unhandled random error', + statusCode: 500, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + }, + }, ];