Moved JSHint into Qunit suite. It's much harder to forget about now!

This commit is contained in:
Robin Ward 2013-06-21 14:06:20 -04:00
parent a4dceed379
commit 82c21868f3
59 changed files with 4320 additions and 181 deletions
test/javascripts/components

View file

@ -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);
};