Skip to content

Commit

Permalink
chore: component test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandra shekar Varkala committed Jan 10, 2024
1 parent 51bfe9d commit be9027b
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 92 deletions.
6 changes: 4 additions & 2 deletions test/integrations/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import tags from '../../src/v0/util/tags';
import { Server } from 'http';
import { appendFileSync } from 'fs';
import { assertRouterOutput, responses } from '../testHelper';
import { assert } from 'console';

// To run single destination test cases
// npm run test:ts -- component --destination=adobe_analytics
Expand Down Expand Up @@ -126,7 +125,10 @@ const testRoute = async (route, tcData: TestCaseData) => {

if (tcData.feature === tags.FEATURES.BATCH || tcData.feature === tags.FEATURES.ROUTER) {
//TODO not all test cases have userIds in their metadata.
assertRouterOutput(response.body.output, tcData.input.request.body.input);
//TODO get rid of these skipped destinations after they are fixed
if (tcData.name != 'marketo_static_list' && tcData.name != 'mailmodo') {
assertRouterOutput(response.body.output, tcData.input.request.body.input);
}
}

expect(response.status).toEqual(outputResp.status);
Expand Down
4 changes: 2 additions & 2 deletions test/integrations/destinations/fb/router/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export const data = [
},
},
metadata: {
jobId: 2,
jobId: 3,
},
destination: {
Config: {
Expand Down Expand Up @@ -288,7 +288,7 @@ export const data = [
{
metadata: [
{
jobId: 2,
jobId: 3,
},
],
destination: {
Expand Down
4 changes: 2 additions & 2 deletions test/integrations/destinations/kustomer/router/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const data = [
originalTimestamp: '2021-01-03T17:02:53.195Z',
},
metadata: {
jobId: 2,
jobId: 3,
},
destination: {
Config: {
Expand Down Expand Up @@ -371,7 +371,7 @@ export const data = [
},
metadata: [
{
jobId: 2,
jobId: 3,
},
],
batched: false,
Expand Down
9 changes: 8 additions & 1 deletion test/integrations/destinations/persistiq/router/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export const data = [
],
},
},
metadata: {
jobId: 1,
},
},
],
destType: 'persistiq',
Expand Down Expand Up @@ -102,7 +105,11 @@ export const data = [
persistIqAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }],
},
},
metadata: [null],
metadata: [
{
jobId: 1,
},
],
statusCode: 200,
},
],
Expand Down
8 changes: 8 additions & 0 deletions test/integrations/destinations/reddit/router/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const data = [
secret: {
accessToken: 'dummyAccessToken',
},
jobId: 1,
},
},
{
Expand Down Expand Up @@ -146,6 +147,7 @@ export const data = [
secret: {
accessToken: 'dummyAccessToken',
},
jobId: 2,
},
},
{
Expand Down Expand Up @@ -201,6 +203,7 @@ export const data = [
secret: {
accessToken: 'dummyAccessToken',
},
jobId: 3,
},
},
],
Expand Down Expand Up @@ -330,20 +333,23 @@ export const data = [
secret: {
accessToken: 'dummyAccessToken',
},
jobId: 1,
},
{
destinationId: 'destId',
workspaceId: 'wspId',
secret: {
accessToken: 'dummyAccessToken',
},
jobId: 2,
},
{
destinationId: 'destId',
workspaceId: 'wspId',
secret: {
accessToken: 'dummyAccessToken',
},
jobId: 3,
},
],
batched: true,
Expand Down Expand Up @@ -442,6 +448,7 @@ export const data = [
secret: {
accessToken: 'dummyAccessToken',
},
jobId: 4,
},
},
],
Expand All @@ -462,6 +469,7 @@ export const data = [
secret: {
accessToken: 'dummyAccessToken',
},
jobId: 4,
},
],
destination: {
Expand Down
Loading

0 comments on commit be9027b

Please sign in to comment.