Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ beforeEach(() => {
// Create Audience Tests
describe('Audience Destination', () => {
describe('createAudience', () => {
it('creates an audience successfully with feature flag ON (v4)', async () => {
it('creates an audience successfully with CANARY VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v4/firstPartyAndPartnerAudiences?advertiserId=12345', {
displayName: audienceName,
Expand All @@ -68,12 +68,12 @@ describe('Audience Destination', () => {

const result = await testDestination.createAudience({
...createAudienceInput,
features: { 'actions-first-party-dv360-version-update': true }
features: { 'first-party-dv360-canary-version': true }
})
expect(result).toEqual({ externalId: 'audience-id-123' })
})

it('creates an audience successfully with feature flag OFF (v3)', async () => {
it('creates an audience successfully with API VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v3/firstAndThirdPartyAudiences?advertiserId=12345', {
displayName: audienceName,
Expand All @@ -88,7 +88,7 @@ describe('Audience Destination', () => {

const result = await testDestination.createAudience({
...createAudienceInput,
features: { 'actions-first-party-dv360-version-update': false }
features: { 'first-party-dv360-canary-version': false }
})
expect(result).toEqual({ externalId: 'audience-id-123' })
})
Expand All @@ -100,28 +100,28 @@ describe('Audience Destination', () => {
})

describe('getAudience', () => {
it('should succeed with feature flag ON (v4)', async () => {
it('should succeed with CANARY VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.get(`/v4/firstPartyAndPartnerAudiences/audience-id-123?advertiserId=12345`)
.matchHeader('Authorization', 'Bearer temp-token')
.reply(200, { firstPartyAndPartnerAudienceId: 'audience-id-123' })

const result = await testDestination.getAudience({
...getAudienceInput,
features: { 'actions-first-party-dv360-version-update': true }
features: { 'first-party-dv360-canary-version': true }
})
expect(result).toEqual({ externalId: 'audience-id-123' })
})

it('should succeed with feature flag OFF (v3)', async () => {
it('should succeed with API VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.get(`/v3/firstAndThirdPartyAudiences/audience-id-123?advertiserId=12345`)
.matchHeader('Authorization', 'Bearer temp-token')
.reply(200, { firstAndThirdPartyAudienceId: 'audience-id-123' })

const result = await testDestination.getAudience({
...getAudienceInput,
features: { 'actions-first-party-dv360-version-update': false }
features: { 'first-party-dv360-canary-version': false }
})
expect(result).toEqual({ externalId: 'audience-id-123' })
})
Expand Down Expand Up @@ -164,14 +164,14 @@ describe('Audience Destination', () => {
}
})

it('should add customer match members successfully with feature flag ON (v4)', async () => {
it('should add customer match members successfully with CANARY VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v4/firstPartyAndPartnerAudiences/audience-id-123:editCustomerMatchMembers')
.reply(200, { firstPartyAndPartnerAudienceId: 'audience-id-123' })
const result = await testDestination.testAction('addToAudContactInfo', {
event,
useDefaultMappings: true,
features: { 'actions-first-party-dv360-version-update': true }
features: { 'first-party-dv360-canary-version': true }
})
expect(result).toContainEqual(
expect.objectContaining({
Expand All @@ -181,14 +181,14 @@ describe('Audience Destination', () => {
})
)
})
it('should add customer match members successfully with feature flag OFF (v3)', async () => {
it('should add customer match members successfully with API VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v3/firstAndThirdPartyAudiences/audience-id-123:editCustomerMatchMembers')
.reply(200, { firstAndThirdPartyAudienceId: 'audience-id-123' })
const result = await testDestination.testAction('addToAudContactInfo', {
event,
useDefaultMappings: true,
features: { 'actions-first-party-dv360-version-update': false }
features: { 'first-party-dv360-canary-version': false }
})
expect(result).toContainEqual(
expect.objectContaining({
Expand All @@ -198,7 +198,7 @@ describe('Audience Destination', () => {
})
)
})
it('should remove customer match members successfully with feature flag ON (v4)', async () => {
it('should remove customer match members successfully with CANARY VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v4/firstPartyAndPartnerAudiences/audience-id-123:editCustomerMatchMembers', {
advertiserId: '12345',
Expand All @@ -224,7 +224,7 @@ describe('Audience Destination', () => {
const result = await testDestination.testAction('removeFromAudContactInfo', {
event,
useDefaultMappings: true,
features: { 'actions-first-party-dv360-version-update': true }
features: { 'first-party-dv360-canary-version': true }
})
expect(result).toContainEqual(
expect.objectContaining({
Expand All @@ -234,7 +234,7 @@ describe('Audience Destination', () => {
})
)
})
it('should remove customer match members successfully with feature flag OFF (v3)', async () => {
it('should remove customer match members successfully with API VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v3/firstAndThirdPartyAudiences/audience-id-123:editCustomerMatchMembers', {
advertiserId: '12345',
Expand All @@ -260,7 +260,7 @@ describe('Audience Destination', () => {
const result = await testDestination.testAction('removeFromAudContactInfo', {
event,
useDefaultMappings: true,
features: { 'actions-first-party-dv360-version-update': false }
features: { 'first-party-dv360-canary-version': false }
})
expect(result).toContainEqual(
expect.objectContaining({
Expand Down Expand Up @@ -294,7 +294,7 @@ describe('Audience Destination', () => {
}
})

it('should add customer match members successfully with feature flag ON (v4)', async () => {
it('should add customer match members successfully with CANARY VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v4/firstPartyAndPartnerAudiences/audience-id-123:editCustomerMatchMembers', {
advertiserId: '12345',
Expand All @@ -311,7 +311,7 @@ describe('Audience Destination', () => {
const result = await testDestination.testAction('addToAudMobileDeviceId', {
event,
useDefaultMappings: true,
features: { 'actions-first-party-dv360-version-update': true }
features: { 'first-party-dv360-canary-version': true }
})
expect(result).toContainEqual(
expect.objectContaining({
Expand All @@ -322,7 +322,7 @@ describe('Audience Destination', () => {
)
})

it('should add customer match members successfully with feature flag OFF (v3)', async () => {
it('should add customer match members successfully with API VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v3/firstAndThirdPartyAudiences/audience-id-123:editCustomerMatchMembers', {
advertiserId: '12345',
Expand All @@ -339,7 +339,7 @@ describe('Audience Destination', () => {
const result = await testDestination.testAction('addToAudMobileDeviceId', {
event,
useDefaultMappings: true,
features: { 'actions-first-party-dv360-version-update': false }
features: { 'first-party-dv360-canary-version': false }
})
expect(result).toContainEqual(
expect.objectContaining({
Expand All @@ -350,7 +350,7 @@ describe('Audience Destination', () => {
)
})

it('should remove customer match members successfully with feature flag ON (v4)', async () => {
it('should remove customer match members successfully with CANARY VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v4/firstPartyAndPartnerAudiences/audience-id-123:editCustomerMatchMembers', {
advertiserId: '12345',
Expand All @@ -367,7 +367,7 @@ describe('Audience Destination', () => {
const result = await testDestination.testAction('removeFromAudMobileDeviceId', {
event,
useDefaultMappings: true,
features: { 'actions-first-party-dv360-version-update': true }
features: { 'first-party-dv360-canary-version': true }
})
expect(result).toContainEqual(
expect.objectContaining({
Expand All @@ -378,7 +378,7 @@ describe('Audience Destination', () => {
)
})

it('should remove customer match members successfully with feature flag OFF (v3)', async () => {
it('should remove customer match members successfully with API VERSION', async () => {
nock('https://displayvideo.googleapis.com')
.post('/v3/firstAndThirdPartyAudiences/audience-id-123:editCustomerMatchMembers', {
advertiserId: '12345',
Expand All @@ -395,7 +395,7 @@ describe('Audience Destination', () => {
const result = await testDestination.testAction('removeFromAudMobileDeviceId', {
event,
useDefaultMappings: true,
features: { 'actions-first-party-dv360-version-update': false }
features: { 'first-party-dv360-canary-version': false }
})
expect(result).toContainEqual(
expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('First-Party-dv360.addToAudContactInfo', () => {
// Optionally, check that the emails are correctly hashed and correspond to the input
})

it('should batch multiple payloads into a single request when enable_batching is true (feature flag ON, v4)', async () => {
it('should batch multiple payloads into a single request when enable_batching is true ( CANARY VERSION )', async () => {
nock('https://displayvideo.googleapis.com/v4/firstPartyAndPartnerAudiences')
.post('/1234567890:editCustomerMatchMembers')
.reply(200, { success: true })
Expand All @@ -127,7 +127,7 @@ describe('First-Party-dv360.addToAudContactInfo', () => {
enable_batching: true,
batch_size: 2
},
features: { 'actions-first-party-dv360-version-update': true }
features: { 'first-party-dv360-canary-version': true }
})

const requestBody = JSON.parse(String(responses[0].options.body))
Expand All @@ -136,7 +136,7 @@ describe('First-Party-dv360.addToAudContactInfo', () => {
expect(requestBody.addedContactInfoList.contactInfos[1].hashedEmails).toBeDefined()
})

it('should batch multiple payloads into a single request when enable_batching is true (feature flag OFF, v3)', async () => {
it('should batch multiple payloads into a single request when enable_batching is true ( API VERSION )', async () => {
nock('https://displayvideo.googleapis.com/v3/firstAndThirdPartyAudiences')
.post('/1234567890:editCustomerMatchMembers')
.reply(200, { success: true })
Expand All @@ -156,7 +156,7 @@ describe('First-Party-dv360.addToAudContactInfo', () => {
enable_batching: true,
batch_size: 2
},
features: { 'actions-first-party-dv360-version-update': false }
features: { 'first-party-dv360-canary-version': false }
})

const requestBody = JSON.parse(String(responses[0].options.body))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const event = createTestEvent({
})

describe('First-Party-dv360.addToAudMobileDeviceId', () => {
it('should use v4 endpoint when feature flag is ON', async () => {
it('should use v4 endpoint when CANARY VERSION', async () => {
nock('https://displayvideo.googleapis.com/v4/firstPartyAndPartnerAudiences')
.post('/1234567890:editCustomerMatchMembers')
.reply(200, { firstPartyAndPartnerAudienceId: '1234567890' })
Expand All @@ -35,7 +35,7 @@ describe('First-Party-dv360.addToAudMobileDeviceId', () => {
enable_batching: false,
batch_size: 1
},
features: { 'actions-first-party-dv360-version-update': true }
features: { 'first-party-dv360-canary-version': true }
})

expect(JSON.parse(responses[0].options.body as string)).toMatchInlineSnapshot(`
Expand All @@ -54,7 +54,7 @@ describe('First-Party-dv360.addToAudMobileDeviceId', () => {
`)
})

it('should use v3 endpoint when feature flag is OFF', async () => {
it('should use v3 endpoint when API VERSION', async () => {
nock('https://displayvideo.googleapis.com/v3/firstAndThirdPartyAudiences')
.post('/1234567890:editCustomerMatchMembers')
.reply(200, { firstAndThirdPartyAudienceId: '1234567890' })
Expand All @@ -68,7 +68,7 @@ describe('First-Party-dv360.addToAudMobileDeviceId', () => {
enable_batching: false,
batch_size: 1
},
features: { 'actions-first-party-dv360-version-update': false }
features: { 'first-party-dv360-canary-version': false }
})

expect(JSON.parse(responses[0].options.body as string)).toMatchInlineSnapshot(`
Expand Down
Loading
Loading