-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP on an inexplicably not passing unit test
- Loading branch information
Showing
3 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...nation-actions/src/destinations/facebook-custom-audiences/__tests__/fb-operations.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import createRequestClient from '../../../../../core/src/request-client' | ||
import FacebookClient, { BASE_URL } from '../fbca-operations' | ||
import { Settings } from '../generated-types' | ||
import nock from 'nock' | ||
|
||
const requestClient = createRequestClient() | ||
const settings: Settings = { | ||
adAccountId: 'act_123456' | ||
} | ||
|
||
describe('Facebook Custom Audiences', () => { | ||
describe('retlOnMappingSave hook', () => { | ||
const facebookClient = new FacebookClient(requestClient, settings.adAccountId) | ||
const hookInputs = { | ||
audienceName: 'test-audience' | ||
} | ||
|
||
it('should create a custom audience in facebook', async () => { | ||
nock(`${BASE_URL}`) | ||
.post(`/${settings.adAccountId}/customaudiences`, { | ||
name: hookInputs.audienceName, | ||
subtype: 'CUSTOM', | ||
customer_file_source: 'BOTH_USER_AND_PARTNER_PROVIDED' | ||
}) | ||
.reply(201, { id: '123' }) | ||
|
||
const { data } = await facebookClient.createAudience(hookInputs.audienceName) | ||
|
||
expect(data).toEqual({ id: '123' }) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters