fix: Add missing referer & initiated_at.timestamp to events (#2920)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user