mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Moved JSHint into Qunit suite. It's much harder to forget about now!
This commit is contained in:
parent
a4dceed379
commit
82c21868f3
59 changed files with 4320 additions and 181 deletions
|
@ -37,9 +37,10 @@ module("Discourse.ClickTrack", {
|
|||
|
||||
var track = Discourse.ClickTrack.trackClick;
|
||||
|
||||
// test
|
||||
var generateClickEventOn = function(selector) {
|
||||
return $.Event("click", { currentTarget: $(selector)[0] });
|
||||
}
|
||||
};
|
||||
|
||||
test("does not track clicks on lightboxes", function() {
|
||||
var clickEvent = generateClickEventOn('.lightbox');
|
||||
|
@ -57,11 +58,11 @@ test("it calls preventDefault when clicking on an a", function() {
|
|||
});
|
||||
|
||||
test("does not track clicks on back buttons", function() {
|
||||
ok(track(generateClickEventOn('.back')))
|
||||
ok(track(generateClickEventOn('.back')));
|
||||
});
|
||||
|
||||
test("does not track clicks on quote buttons", function() {
|
||||
ok(track(generateClickEventOn('.quote-other-topic')))
|
||||
ok(track(generateClickEventOn('.quote-other-topic')));
|
||||
});
|
||||
|
||||
test("removes the href and put it as a data attribute", function() {
|
||||
|
@ -99,7 +100,7 @@ test("updates badge counts correctly", function() {
|
|||
});
|
||||
|
||||
var trackRightClick = function() {
|
||||
var clickEvent = generateClickEventOn('a')
|
||||
var clickEvent = generateClickEventOn('a');
|
||||
clickEvent.which = 3;
|
||||
return track(clickEvent);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue