Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit 3f2e753

Browse files
fblundunalexanderdean
authored andcommitted
Added test for trackSocialInteraction (closes snowplow#258)
1 parent c58ba77 commit 3f2e753

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

core/CHANGELOG

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Version 0.3.0 (2014-xx-xx)
22
--------------------------
3-
Apply callback to the Payload for an event rather than the event dictionary (#259)
3+
Applied callback to the Payload for an event rather than the event dictionary (#259)
44
Added page scroll parameters to trackPagePing (#257)
5-
Added social tracking (#258) (TODO)
5+
Added social tracking (#258)
6+
Add addTo- and removeFrom- basket methods (#260) (TODO)
67

78
Version 0.2.0 (2014-08-07)
89
--------------------------

core/tests/core.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,33 @@ define([
290290
compare(tracker.trackAdConversion(conversionId, costModel, cost, category, action, property, initialValue, advertiserId, campaignId), expected, 'An ad conversion should be tracked correctly');
291291
},
292292

293+
"Track a social interaction": function () {
294+
var action = 'like';
295+
var network = 'facebook';
296+
var target = 'status-0000345345';
297+
var pagepath = 'http://www.mypage.com';
298+
299+
var inputJson = {
300+
schema: 'iglu:com.snowplowanalytics.snowplow/social_interaction/jsonschema/1-0-0',
301+
data: {
302+
action: action,
303+
network: network,
304+
target: target,
305+
pagepath: pagepath
306+
}
307+
};
308+
309+
var expected = {
310+
e: 'ue',
311+
ue_pr: JSON.stringify({
312+
schema: unstructEventSchema,
313+
data: inputJson
314+
})
315+
};
316+
317+
compare(tracker.trackSocialInteraction(action, network, target, pagepath), expected);
318+
},
319+
293320
"Track a page view with custom context": function () {
294321
var url = 'http://www.example.com';
295322
var page = 'title page';

0 commit comments

Comments
 (0)