fix: Add missing referer & initiated_at.timestamp to events (#2920)

This commit is contained in:
Pranav Raj S
2021-08-31 11:46:15 +05:30
committed by GitHub
parent 588f49cc34
commit 75329e5de1
3 changed files with 24 additions and 1 deletions

View File

@@ -47,6 +47,10 @@ describe('#getConversation', () => {
describe('#triggerCampaign', () => {
it('should returns correct payload', () => {
const spy = jest.spyOn(global, 'Date').mockImplementation(() => ({
toString: () => 'mock date',
}));
const windowSpy = jest.spyOn(window, 'window', 'get');
const websiteToken = 'ADSDJ2323MSDSDFMMMASDM';
const campaignId = 12;
expect(
@@ -60,11 +64,18 @@ describe('#triggerCampaign', () => {
name: 'campaign.triggered',
event_info: {
campaign_id: campaignId,
referer: '',
initiated_at: {
timestamp: 'mock date',
},
},
},
params: {
website_token: websiteToken,
},
});
windowSpy.mockRestore();
spy.mockRestore();
});
});