summaryrefslogtreecommitdiff
path: root/js_tests
diff options
context:
space:
mode:
authorNik Nyby <nikolas@gnu.org>2015-08-26 00:24:55 -0400
committerTim Graham <timograham@gmail.com>2015-09-02 13:52:38 -0400
commit722bf23518afad6fd90694c17484da33551e4cef (patch)
tree2691ad771db7fe67e207ef5f96221687316b7f5c /js_tests
parent0e925de245a0a1bf5d063c816c8bff9f0280a4c7 (diff)
Added linting for JavaScript tests.
Diffstat (limited to 'js_tests')
-rw-r--r--js_tests/admin/DateTimeShortcuts.test.js4
-rw-r--r--js_tests/admin/RelatedObjectLookups.test.js5
-rw-r--r--js_tests/admin/SelectBox.test.js6
-rw-r--r--js_tests/admin/SelectFilter2.test.js4
-rw-r--r--js_tests/admin/actions.test.js6
-rw-r--r--js_tests/admin/core.test.js4
-rw-r--r--js_tests/admin/inlines.test.js4
-rw-r--r--js_tests/admin/jsi18n-mocks.test.js34
-rw-r--r--js_tests/admin/timeparse.test.js4
9 files changed, 57 insertions, 14 deletions
diff --git a/js_tests/admin/DateTimeShortcuts.test.js b/js_tests/admin/DateTimeShortcuts.test.js
index fb5f15c5aa..2fc9d9a8c6 100644
--- a/js_tests/admin/DateTimeShortcuts.test.js
+++ b/js_tests/admin/DateTimeShortcuts.test.js
@@ -1,3 +1,7 @@
+/* global module, test, DateTimeShortcuts */
+/* eslint global-strict: 0, strict: 0 */
+'use strict';
+
module('admin.DateTimeShortcuts');
test('init', function(assert) {
diff --git a/js_tests/admin/RelatedObjectLookups.test.js b/js_tests/admin/RelatedObjectLookups.test.js
index b2e2e1841b..d2fd3194bb 100644
--- a/js_tests/admin/RelatedObjectLookups.test.js
+++ b/js_tests/admin/RelatedObjectLookups.test.js
@@ -1,3 +1,8 @@
+/* global module, test, html_unescape, id_to_windowname,
+ windowname_to_id */
+/* eslint global-strict: 0, strict: 0 */
+'use strict';
+
module('admin.RelatedObjectLookups');
test('html_unescape', function(assert) {
diff --git a/js_tests/admin/SelectBox.test.js b/js_tests/admin/SelectBox.test.js
index b2e36e0ab2..cb0259d12c 100644
--- a/js_tests/admin/SelectBox.test.js
+++ b/js_tests/admin/SelectBox.test.js
@@ -1,10 +1,14 @@
+/* global module, test, SelectBox */
+/* eslint global-strict: 0, strict: 0 */
+'use strict';
+
module('admin.SelectBox');
test('init: no options', function(assert) {
var $ = django.jQuery;
$('<select id="id"></select>').appendTo('#qunit-fixture');
SelectBox.init('id');
- assert.equal(SelectBox.cache['id'].length, 0);
+ assert.equal(SelectBox.cache.id.length, 0);
});
test('filter', function(assert) {
diff --git a/js_tests/admin/SelectFilter2.test.js b/js_tests/admin/SelectFilter2.test.js
index a06c3ab49c..1aa97958cb 100644
--- a/js_tests/admin/SelectFilter2.test.js
+++ b/js_tests/admin/SelectFilter2.test.js
@@ -1,3 +1,7 @@
+/* global module, test, SelectFilter */
+/* eslint global-strict: 0, strict: 0 */
+'use strict';
+
module('admin.SelectFilter2');
test('init', function(assert) {
diff --git a/js_tests/admin/actions.test.js b/js_tests/admin/actions.test.js
index 01e9267b94..d26d16328c 100644
--- a/js_tests/admin/actions.test.js
+++ b/js_tests/admin/actions.test.js
@@ -1,7 +1,13 @@
+/* global module, test */
+/* eslint global-strict: 0, strict: 0 */
+'use strict';
+
module('admin.actions', {
beforeEach: function() {
// Number of results shown on page
+ /* eslint-disable */
window._actions_icnt = '100';
+ /* eslint-enable */
var $ = django.jQuery;
$('#qunit-fixture').append($('#result-table').text());
diff --git a/js_tests/admin/core.test.js b/js_tests/admin/core.test.js
index 044a1d5787..0d6a12d44c 100644
--- a/js_tests/admin/core.test.js
+++ b/js_tests/admin/core.test.js
@@ -1,3 +1,7 @@
+/* global module, test */
+/* eslint global-strict: 0, strict: 0 */
+'use strict';
+
module('admin.core');
test('Date.getTwelveHours', function(assert) {
diff --git a/js_tests/admin/inlines.test.js b/js_tests/admin/inlines.test.js
index 1edf2b511c..5fb63813f8 100644
--- a/js_tests/admin/inlines.test.js
+++ b/js_tests/admin/inlines.test.js
@@ -1,3 +1,7 @@
+/* global module, test */
+/* eslint global-strict: 0, strict: 0 */
+'use strict';
+
module('admin.inlines: tabular formsets', {
beforeEach: function() {
var $ = django.jQuery;
diff --git a/js_tests/admin/jsi18n-mocks.test.js b/js_tests/admin/jsi18n-mocks.test.js
index dcd7c67c3e..4858de6eb3 100644
--- a/js_tests/admin/jsi18n-mocks.test.js
+++ b/js_tests/admin/jsi18n-mocks.test.js
@@ -1,22 +1,30 @@
-(function (globals) {
-
+(function(globals) {
+ 'use strict';
var django = globals.django || (globals.django = {});
- django.pluralidx = function (count) { return (count == 1) ? 0 : 1; };
+ django.pluralidx = function(count) { return (count === 1) ? 0 : 1; };
/* gettext identity library */
- django.gettext = function (msgid) { return msgid; };
- django.ngettext = function (singular, plural, count) { return (count == 1) ? singular : plural; };
- django.gettext_noop = function (msgid) { return msgid; };
- django.pgettext = function (context, msgid) { return msgid; };
- django.npgettext = function (context, singular, plural, count) { return (count == 1) ? singular : plural; };
+ django.gettext = function(msgid) { return msgid; };
+ django.ngettext = function(singular, plural, count) {
+ return (count === 1) ? singular : plural;
+ };
+ django.gettext_noop = function(msgid) { return msgid; };
+ django.pgettext = function(context, msgid) { return msgid; };
+ django.npgettext = function(context, singular, plural, count) {
+ return (count === 1) ? singular : plural;
+ };
- django.interpolate = function (fmt, obj, named) {
+ django.interpolate = function(fmt, obj, named) {
if (named) {
- return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
+ return fmt.replace(/%\(\w+\)s/g, function(match) {
+ return String(obj[match.slice(2, -2)]);
+ });
} else {
- return fmt.replace(/%s/g, function(match){return String(obj.shift())});
+ return fmt.replace(/%s/g, function(match) {
+ return String(obj.shift());
+ });
}
};
@@ -60,9 +68,9 @@
"YEAR_MONTH_FORMAT": "F Y"
};
- django.get_format = function (format_type) {
+ django.get_format = function(format_type) {
var value = django.formats[format_type];
- if (typeof(value) == 'undefined') {
+ if (typeof value === 'undefined') {
return format_type;
} else {
return value;
diff --git a/js_tests/admin/timeparse.test.js b/js_tests/admin/timeparse.test.js
index 86479c4f3f..e5d1b2cf26 100644
--- a/js_tests/admin/timeparse.test.js
+++ b/js_tests/admin/timeparse.test.js
@@ -1,3 +1,7 @@
+/* global module, test, parseTimeString */
+/* eslint global-strict: 0, strict: 0 */
+'use strict';
+
module('admin.timeparse');
test('parseTimeString', function(assert) {