FIX: don't track clicks on links in quotes

This commit is contained in:
Régis Hanol
2016-05-03 18:47:01 +02:00
parent c069488560
commit ad15049ef0
4 changed files with 26 additions and 5 deletions

View File

@ -31,6 +31,10 @@ module("lib:click-track", {
<a id="same-site" href="http://discuss.domain.com">forum</a>
<a class="attachment" href="http://discuss.domain.com/uploads/default/1234/1532357280.txt">log.txt</a>
<a class="hashtag" href="http://discuss.domain.com">#hashtag</a>
<a class="mailto" href="mailto:foo@bar.com">email-me</a>
<aside class="quote">
<a class="inside-quote" href="http://discuss.domain.com">foobar</a>
</aside>
</article>
</div>`);
}
@ -66,12 +70,20 @@ test("does not track clicks on back buttons", function() {
ok(track(generateClickEventOn('.back')));
});
test("does not track clicks in quotes", function() {
ok(track(generateClickEventOn('.inside-quote')));
});
test("does not track clicks on quote buttons", function() {
ok(track(generateClickEventOn('.quote-other-topic')));
});
test("does not track clicks on category badges", () => {
ok(!track(generateClickEventOn('.hashtag')));
ok(track(generateClickEventOn('.hashtag')));
});
test("does not track clicks on mailto", function() {
ok(track(generateClickEventOn('.mailto')));
});
test("removes the href and put it as a data attribute", function() {