chore: Execute campaigns based on matching URL (#2254)

This commit is contained in:
Muhsin Keloth
2021-05-17 21:38:35 +05:30
committed by GitHub
parent 18cea3b0ac
commit 610a7c661e
13 changed files with 242 additions and 45 deletions

View File

@@ -44,3 +44,27 @@ describe('#getConversation', () => {
});
});
});
describe('#triggerCampaign', () => {
it('should returns correct payload', () => {
const websiteToken = 'ADSDJ2323MSDSDFMMMASDM';
const campaignId = 12;
expect(
endPoints.triggerCampaign({
websiteToken,
campaignId,
})
).toEqual({
url: `/api/v1/widget/events`,
data: {
name: 'campaign.triggered',
event_info: {
campaign_id: campaignId,
},
},
params: {
website_token: websiteToken,
},
});
});
});