mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: don't track clicks on links in quotes
This commit is contained in:
@ -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() {
|
||||
|
Reference in New Issue
Block a user