diff --git a/.jshintrc b/.jshintrc
index 94299268..51b3fbd9 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -10,10 +10,8 @@
"define": false,
"document": false,
"MockContainer": false,
- "module": false,
"QUnit": false,
"require": false,
- "test": false,
"window": false
},
"indent": 2,
diff --git a/tests/a11y/selection-tests.js b/tests/a11y/selection-tests.js
index b2f1b2e4..b401958d 100644
--- a/tests/a11y/selection-tests.js
+++ b/tests/a11y/selection-tests.js
@@ -1,4 +1,4 @@
-module('Accessibility - All');
+QUnit.module('Accessibility - All');
var BaseSelection = require('select2/selection/base');
var SingleSelection = require('select2/selection/single');
@@ -9,7 +9,7 @@ var $ = require('jquery');
var Options = require('select2/options');
var options = new Options({});
-test('title is carried over from original element', function (assert) {
+QUnit.test('title is carried over from original element', function (assert) {
var $select = $('#qunit-fixture .single');
var selection = new BaseSelection($select, options);
@@ -22,32 +22,35 @@ test('title is carried over from original element', function (assert) {
);
});
-test('aria-expanded reflects the state of the container', function (assert) {
- var $select = $('#qunit-fixture .single');
+QUnit.test(
+ 'aria-expanded reflects the state of the container',
+ function (assert) {
+ var $select = $('#qunit-fixture .single');
- var selection = new BaseSelection($select, options);
- var $selection = selection.render();
+ var selection = new BaseSelection($select, options);
+ var $selection = selection.render();
- var container = new MockContainer();
+ var container = new MockContainer();
- selection.bind(container, $(''));
+ selection.bind(container, $(''));
- assert.equal(
- $selection.attr('aria-expanded'),
- 'false',
- 'The container should not be expanded when it is closed'
- );
+ assert.equal(
+ $selection.attr('aria-expanded'),
+ 'false',
+ 'The container should not be expanded when it is closed'
+ );
- container.trigger('open');
+ container.trigger('open');
- assert.equal(
- $selection.attr('aria-expanded'),
- 'true',
- 'The container should be expanded when it is opened'
- );
-});
+ assert.equal(
+ $selection.attr('aria-expanded'),
+ 'true',
+ 'The container should be expanded when it is opened'
+ );
+ }
+);
-test('static aria attributes are present', function (assert) {
+QUnit.test('static aria attributes are present', function (assert) {
var $select = $('#qunit-fixture .single');
var selection = new BaseSelection($select, options);
@@ -66,7 +69,7 @@ test('static aria attributes are present', function (assert) {
);
});
-test('the container should be in the tab order', function (assert) {
+QUnit.test('the container should be in the tab order', function (assert) {
var $select = $('#qunit-fixture .single');
var selection = new BaseSelection($select, options);
@@ -98,7 +101,7 @@ test('the container should be in the tab order', function (assert) {
);
});
-test('a custom tabindex is copied', function (assert) {
+QUnit.test('a custom tabindex is copied', function (assert) {
var $select = $('#qunit-fixture .single');
$select.attr('tabindex', '999');
@@ -131,7 +134,7 @@ test('a custom tabindex is copied', function (assert) {
);
});
-test('aria-disabled should reflected disabled state', function (assert) {
+QUnit.test('aria-disabled should reflected disabled state', function (assert) {
var $select = $('#qunit-fixture .single');
var selection = new BaseSelection($select, options);
@@ -163,24 +166,27 @@ test('aria-disabled should reflected disabled state', function (assert) {
);
});
-module('Accessibility - Single');
+QUnit.module('Accessibility - Single');
-test('aria-labelledby should match the rendered container', function (assert) {
- var $select = $('#qunit-fixture .single');
+QUnit.test(
+ 'aria-labelledby should match the rendered container',
+ function (assert) {
+ var $select = $('#qunit-fixture .single');
- var selection = new SingleSelection($select, options);
- var $selection = selection.render();
+ var selection = new SingleSelection($select, options);
+ var $selection = selection.render();
- var container = new MockContainer();
- selection.bind(container, $(''));
+ var container = new MockContainer();
+ selection.bind(container, $(''));
- var $rendered = $selection.find('.select2-selection__rendered');
+ var $rendered = $selection.find('.select2-selection__rendered');
- assert.equal(
- $selection.attr('aria-labelledby'),
- $rendered.attr('id'),
- 'The rendered selection should label the container'
- );
-});
+ assert.equal(
+ $selection.attr('aria-labelledby'),
+ $rendered.attr('id'),
+ 'The rendered selection should label the container'
+ );
+ }
+);
-module('Accessibility - Multiple');
+QUnit.module('Accessibility - Multiple');
diff --git a/tests/data/array-tests.js b/tests/data/array-tests.js
index e0c8a266..be91aab7 100644
--- a/tests/data/array-tests.js
+++ b/tests/data/array-tests.js
@@ -1,4 +1,4 @@
-module('Data adapters - Array');
+QUnit.module('Data adapters - Array');
var ArrayData = require('select2/data/array');
var $ = require('jquery');
@@ -66,7 +66,7 @@ var nestedOptions = new Options({
]
});
-test('current gets default for single', function (assert) {
+QUnit.test('current gets default for single', function (assert) {
var $select = $('#qunit-fixture .single-empty');
var data = new ArrayData($select, arrayOptions);
@@ -91,7 +91,7 @@ test('current gets default for single', function (assert) {
});
});
-test('current gets default for multiple', function (assert) {
+QUnit.test('current gets default for multiple', function (assert) {
var $select = $('#qunit-fixture .multiple');
var data = new ArrayData($select, arrayOptions);
@@ -108,7 +108,7 @@ test('current gets default for multiple', function (assert) {
});
});
-test('current works with existing selections', function (assert) {
+QUnit.test('current works with existing selections', function (assert) {
var $select = $('#qunit-fixture .multiple');
var data = new ArrayData($select, arrayOptions);
@@ -141,7 +141,7 @@ test('current works with existing selections', function (assert) {
});
});
-test('current works with selected data', function (assert) {
+QUnit.test('current works with selected data', function (assert) {
var $select = $('#qunit-fixture .single-empty');
var data = new ArrayData($select, arrayOptions);
@@ -177,7 +177,7 @@ test('current works with selected data', function (assert) {
});
});
-test('select works for single', function (assert) {
+QUnit.test('select works for single', function (assert) {
var $select = $('#qunit-fixture .single-empty');
var data = new ArrayData($select, arrayOptions);
@@ -203,7 +203,7 @@ test('select works for single', function (assert) {
);
});
-test('multiple sets the value', function (assert) {
+QUnit.test('multiple sets the value', function (assert) {
var $select = $('#qunit-fixture .multiple');
var data = new ArrayData($select, arrayOptions);
@@ -224,7 +224,7 @@ test('multiple sets the value', function (assert) {
assert.deepEqual($select.val(), ['default']);
});
-test('multiple adds to the old value', function (assert) {
+QUnit.test('multiple adds to the old value', function (assert) {
var $select = $('#qunit-fixture .multiple');
var data = new ArrayData($select, arrayOptions);
@@ -244,7 +244,7 @@ test('multiple adds to the old value', function (assert) {
assert.deepEqual($select.val(), ['One', 'default']);
});
-test('option tags are automatically generated', function (assert) {
+QUnit.test('option tags are automatically generated', function (assert) {
var $select = $('#qunit-fixture .single-empty');
var data = new ArrayData($select, arrayOptions);
@@ -259,7 +259,7 @@ test('option tags are automatically generated', function (assert) {
);
});
-test('automatically generated option tags have a result id', function (assert) {
+QUnit.test('automatically generated option tags have a result id', function (assert) {
var $select = $('#qunit-fixture .single-empty');
var data = new ArrayData($select, arrayOptions);
@@ -277,7 +277,7 @@ test('automatically generated option tags have a result id', function (assert) {
);
});
-test('option tags can receive new data', function(assert) {
+QUnit.test('option tags can receive new data', function(assert) {
var $select = $('#qunit-fixture .single');
var data = new ArrayData($select, extraOptions);
@@ -310,7 +310,7 @@ test('option tags can receive new data', function(assert) {
);
});
-test('optgroup tags can also be generated', function (assert) {
+QUnit.test('optgroup tags can also be generated', function (assert) {
var $select = $('#qunit-fixture .single-empty');
var data = new ArrayData($select, nestedOptions);
@@ -331,7 +331,7 @@ test('optgroup tags can also be generated', function (assert) {
);
});
-test('optgroup tags have the right properties', function (assert) {
+QUnit.test('optgroup tags have the right properties', function (assert) {
var $select = $('#qunit-fixture .single-empty');
var data = new ArrayData($select, nestedOptions);
@@ -354,7 +354,7 @@ test('optgroup tags have the right properties', function (assert) {
);
});
-test('existing selections are respected on initialization', function (assert) {
+QUnit.test('existing selections are respected on initialization', function (assert) {
var $select = $(
''
);
-
+
// Initialize.
$select.select2({maximumSelectionLength: 2, multiple: true});
-
+
assert.equal(
$select.val(),
'3',
@@ -83,15 +83,15 @@ test('$element.data returns instance and options correctly',
);
// Try to resolve instance via .data('select2').
- var $instance = $select.data('select2');
+ var $instance = $select.data('select2');
assert.ok($instance);
assert.ok($instance.options);
- // Ensure $select.data('select2') is the same instance
- // created by .select2()
- assert.equal($instance, Utils.GetData($instance.$element[0],
+ // Ensure $select.data('select2') is the same instance
+ // created by .select2()
+ assert.equal($instance, Utils.GetData($instance.$element[0],
'select2'));
-
+
// Ensure initialized property matches.
assert.equal($instance.options.options.maximumSelectionLength,
2);
diff --git a/tests/integration/select2-methods.js b/tests/integration/select2-methods.js
index b1e344a5..01523541 100644
--- a/tests/integration/select2-methods.js
+++ b/tests/integration/select2-methods.js
@@ -1,10 +1,10 @@
-module('select2(data)');
+QUnit.module('select2(data)');
var $ = require('jquery');
var Select2 = require('select2/core');
var Options = require('select2/options');
-test('single default selection returned', function (assert) {
+QUnit.test('single default selection returned', function (assert) {
var $select = $(
'' +
'' +
@@ -39,7 +39,7 @@ test('single default selection returned', function (assert) {
);
});
-test('multiple default selections returned', function (assert) {
+QUnit.test('multiple default selections returned', function (assert) {
var $select = $(
'' +
'' +
@@ -76,9 +76,9 @@ test('multiple default selections returned', function (assert) {
);
});
-module('select2(val)');
+QUnit.module('select2(val)');
-test('single value matches jquery value', function (assert) {
+QUnit.test('single value matches jquery value', function (assert) {
var $select = $(
'' +
'' +
@@ -105,7 +105,7 @@ test('single value matches jquery value', function (assert) {
);
});
-test('multiple value matches the jquery value', function (assert) {
+QUnit.test('multiple value matches the jquery value', function (assert) {
var $select = $(
'' +
'' +
diff --git a/tests/options/ajax-tests.js b/tests/options/ajax-tests.js
index eb65e9ef..70254a96 100644
--- a/tests/options/ajax-tests.js
+++ b/tests/options/ajax-tests.js
@@ -1,6 +1,6 @@
-module('Defaults - Ajax');
+QUnit.module('Defaults - Ajax');
-test('options are merged recursively with default options', function (assert) {
+QUnit.test('options are merged recursively with default options', function (assert) {
var defaults = require('select2/defaults');
var ajaxDelay = 250;
@@ -31,7 +31,7 @@ test('options are merged recursively with default options', function (assert) {
defaults.reset();
});
-test('more than one default option can be changed via set()', function(assert) {
+QUnit.test('more than one default option can be changed via set()', function(assert) {
var defaults = require('select2/defaults');
var ajaxDelay = 123;
var dataDataType = 'xml';
diff --git a/tests/options/data-tests.js b/tests/options/data-tests.js
index 107a2f0c..af6958eb 100644
--- a/tests/options/data-tests.js
+++ b/tests/options/data-tests.js
@@ -1,10 +1,10 @@
-module('Options - Attributes');
+QUnit.module('Options - Attributes');
var $ = require('jquery');
var Options = require('select2/options');
-test('no nesting', function (assert) {
+QUnit.test('no nesting', function (assert) {
var $test = $('');
var options = new Options({}, $test);
@@ -12,7 +12,7 @@ test('no nesting', function (assert) {
assert.equal(options.get('test'), 'test');
});
-test('with nesting', function (assert) {
+QUnit.test('with nesting', function (assert) {
var $test = $('');
if ($test[0].dataset == null) {
@@ -30,7 +30,7 @@ test('with nesting', function (assert) {
assert.equal(options.get('first').second, 'test');
});
-test('overrides initialized data', function (assert) {
+QUnit.test('overrides initialized data', function (assert) {
var $test = $('');
var options = new Options({
diff --git a/tests/options/deprecated-tests.js b/tests/options/deprecated-tests.js
index a51bba31..a9433c93 100644
--- a/tests/options/deprecated-tests.js
+++ b/tests/options/deprecated-tests.js
@@ -1,9 +1,9 @@
-module('Options - Deprecated - initSelection');
+QUnit.module('Options - Deprecated - initSelection');
var $ = require('jquery');
var Options = require('select2/options');
-test('converted into dataAdapter.current', function (assert) {
+QUnit.test('converted into dataAdapter.current', function (assert) {
assert.expect(5);
var $test = $('');
@@ -50,7 +50,7 @@ test('converted into dataAdapter.current', function (assert) {
assert.ok(called, 'initSelection should have been called');
});
-test('single option converted to array automatically', function (assert) {
+QUnit.test('single option converted to array automatically', function (assert) {
assert.expect(2);
var $test = $('');
@@ -80,7 +80,7 @@ test('single option converted to array automatically', function (assert) {
assert.ok(called, 'initSelection should have been called');
});
-test('only called once', function (assert) {
+QUnit.test('only called once', function (assert) {
assert.expect(8);
var $test = $('');
@@ -157,9 +157,9 @@ test('only called once', function (assert) {
);
});
-module('Options - Deprecated - query');
+QUnit.module('Options - Deprecated - query');
-test('converted into dataAdapter.query automatically', function (assert) {
+QUnit.test('converted into dataAdapter.query automatically', function (assert) {
assert.expect(6);
var $test = $('');
@@ -217,9 +217,9 @@ test('converted into dataAdapter.query automatically', function (assert) {
assert.ok(called, 'The query function should have been called');
});
-module('Options - deprecated - data-ajax-url');
+QUnit.module('Options - deprecated - data-ajax-url');
-test('converted ajax-url to ajax--url automatically', function (assert) {
+QUnit.test('converted ajax-url to ajax--url automatically', function (assert) {
var $test = $('');
var options = new Options({}, $test);
@@ -234,7 +234,7 @@ test('converted ajax-url to ajax--url automatically', function (assert) {
);
});
-test('converted select2-tags to data/tags automatically', function (assert) {
+QUnit.test('converted select2-tags to data/tags automatically', function (assert) {
var $test = $('');
var options = new Options({}, $test);
diff --git a/tests/options/translation-tests.js b/tests/options/translation-tests.js
index 34b86d33..00479ec8 100644
--- a/tests/options/translation-tests.js
+++ b/tests/options/translation-tests.js
@@ -1,3 +1,5 @@
+QUnit.module('Options - Translations');
+
var $ = require('jquery');
var Options = require('select2/options');
var Defaults = require('select2/defaults');
@@ -58,7 +60,7 @@ test(
}
);
-test('partial dictionaries can be passed', function (assert) {
+QUnit.test('partial dictionaries can be passed', function (assert) {
var $element = $('');
var options = new Options({
diff --git a/tests/options/width-tests.js b/tests/options/width-tests.js
index 4f774b9c..21e00fe3 100644
--- a/tests/options/width-tests.js
+++ b/tests/options/width-tests.js
@@ -1,11 +1,11 @@
-module('Options - Width');
+QUnit.module('Options - Width');
var $ = require('jquery');
var Select2 = require('select2/core');
var select = new Select2($(''));
-test('string passed as width', function (assert) {
+QUnit.test('string passed as width', function (assert) {
var $test = $('');
var width = select._resolveWidth($test, '80%');
@@ -13,7 +13,7 @@ test('string passed as width', function (assert) {
assert.equal(width, '80%');
});
-test('width from style attribute', function (assert) {
+QUnit.test('width from style attribute', function (assert) {
var $test = $('');
var width = select._resolveWidth($test, 'style');
@@ -21,7 +21,7 @@ test('width from style attribute', function (assert) {
assert.equal(width, '50%');
});
-test('width from style returns null if nothing is found', function (assert) {
+QUnit.test('width from style returns null if nothing is found', function (assert) {
var $test = $('');
var width = select._resolveWidth($test, 'style');
@@ -29,7 +29,7 @@ test('width from style returns null if nothing is found', function (assert) {
assert.equal(width, null);
});
-test('width from computed element width', function (assert) {
+QUnit.test('width from computed element width', function (assert) {
var $style = $(
''
);
@@ -43,7 +43,7 @@ test('width from computed element width', function (assert) {
assert.equal(width, '500px');
});
-test('resolve gets the style if it is there', function (assert) {
+QUnit.test('resolve gets the style if it is there', function (assert) {
var $test = $('');
var width = select._resolveWidth($test, 'resolve');
@@ -51,7 +51,7 @@ test('resolve gets the style if it is there', function (assert) {
assert.equal(width, '20%');
});
-test('resolve falls back to element if there is no style', function (assert) {
+QUnit.test('resolve falls back to element if there is no style', function (assert) {
var $style = $(
''
);
@@ -65,7 +65,7 @@ test('resolve falls back to element if there is no style', function (assert) {
assert.equal(width, '500px');
});
-test('computedstyle gets the style if parent is invisible', function (assert) {
+QUnit.test('computedstyle gets the style if parent is invisible', function (assert) {
var $style = $(
''
);
diff --git a/tests/results/a11y-tests.js b/tests/results/a11y-tests.js
index ca01f21f..853aba53 100644
--- a/tests/results/a11y-tests.js
+++ b/tests/results/a11y-tests.js
@@ -1,4 +1,4 @@
-module('Results - Accessibility');
+QUnit.module('Results - Accessibility');
var $ = require('jquery');
@@ -6,7 +6,7 @@ var Options = require('select2/options');
var Results = require('select2/results');
-test('role of results should be a listbox', function (assert) {
+QUnit.test('role of results should be a listbox', function (assert) {
var results = new Results($(''), new Options({}));
var $results = results.render();
@@ -14,7 +14,7 @@ test('role of results should be a listbox', function (assert) {
assert.equal($results.attr('role'), 'listbox');
});
-test('multiple select should have aria-multiselectable', function (assert) {
+QUnit.test('multiple select should have aria-multiselectable', function (assert) {
var results = new Results($(''), new Options({
multiple: true
}));
diff --git a/tests/results/focusing-tests.js b/tests/results/focusing-tests.js
index 08a2ef3c..41f21480 100644
--- a/tests/results/focusing-tests.js
+++ b/tests/results/focusing-tests.js
@@ -1,6 +1,6 @@
-module('Results - highlighting results');
+QUnit.module('Results - highlighting results');
-test('results:all with no data skips results:focus', function (assert) {
+QUnit.test('results:all with no data skips results:focus', function (assert) {
assert.expect(0);
var $ = require('jquery');
@@ -42,7 +42,7 @@ test('results:all with no data skips results:focus', function (assert) {
});
});
-test('results:all triggers results:focus on the first item', function (assert) {
+QUnit.test('results:all triggers results:focus on the first item', function (assert) {
assert.expect(2);
var $ = require('jquery');
@@ -90,7 +90,7 @@ test('results:all triggers results:focus on the first item', function (assert) {
});
});
-test('results:append does not trigger results:focus', function (assert) {
+QUnit.test('results:append does not trigger results:focus', function (assert) {
assert.expect(0);
var $ = require('jquery');
@@ -137,7 +137,7 @@ test('results:append does not trigger results:focus', function (assert) {
});
});
-test('scrollAfterSelect triggers results:focus', function (assert) {
+QUnit.test('scrollAfterSelect triggers results:focus', function (assert) {
assert.expect(3);
var $ = require('jquery');
@@ -189,7 +189,7 @@ test('scrollAfterSelect triggers results:focus', function (assert) {
container.trigger('select', {});
});
-test('!scrollAfterSelect does not trigger results:focus', function (assert) {
+QUnit.test('!scrollAfterSelect does not trigger results:focus', function (assert) {
assert.expect(1);
var $ = require('jquery');
diff --git a/tests/results/infiniteScroll-tests.js b/tests/results/infiniteScroll-tests.js
index 89bece63..33c721be 100644
--- a/tests/results/infiniteScroll-tests.js
+++ b/tests/results/infiniteScroll-tests.js
@@ -1,6 +1,6 @@
-module('Results - Infinite scrolling');
+QUnit.module('Results - Infinite scrolling');
-test('loadingMore is triggered even without a scrollbar', function (assert) {
+QUnit.test('loadingMore is triggered even without a scrollbar', function (assert) {
assert.expect(1);
var $ = require('jquery');
@@ -49,7 +49,7 @@ test('loadingMore is triggered even without a scrollbar', function (assert) {
});
});
-test('loadingMore is not triggered without scrolling', function (assert) {
+QUnit.test('loadingMore is not triggered without scrolling', function (assert) {
assert.expect(0);
var $ = require('jquery');
diff --git a/tests/results/option-tests.js b/tests/results/option-tests.js
index 96570501..c13c24e4 100644
--- a/tests/results/option-tests.js
+++ b/tests/results/option-tests.js
@@ -1,4 +1,4 @@
-module('Results - option');
+QUnit.module('Results - option');
var $ = require('jquery');
@@ -6,7 +6,7 @@ var Options = require('select2/options');
var Results = require('select2/results');
-test('disabled property on option is respected - enabled', function (assert) {
+QUnit.test('disabled property on option is respected - enabled', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
@@ -17,7 +17,7 @@ test('disabled property on option is respected - enabled', function (assert) {
assert.notEqual(option.getAttribute('aria-disabled'), 'true');
});
-test('disabled property on option is respected - disabled', function (assert) {
+QUnit.test('disabled property on option is respected - disabled', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
@@ -28,7 +28,7 @@ test('disabled property on option is respected - disabled', function (assert) {
assert.equal(option.getAttribute('aria-disabled'), 'true');
});
-test('disabled property on enabled optgroup is respected', function (assert) {
+QUnit.test('disabled property on enabled optgroup is respected', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
@@ -39,7 +39,7 @@ test('disabled property on enabled optgroup is respected', function (assert) {
assert.notEqual(option.getAttribute('aria-disabled'), 'true');
});
-test('disabled property on disabled optgroup is respected', function (assert) {
+QUnit.test('disabled property on disabled optgroup is respected', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
@@ -50,7 +50,7 @@ test('disabled property on disabled optgroup is respected', function (assert) {
assert.equal(option.getAttribute('aria-disabled'), 'true');
});
-test('option in disabled optgroup is disabled', function (assert) {
+QUnit.test('option in disabled optgroup is disabled', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('')
@@ -62,7 +62,7 @@ test('option in disabled optgroup is disabled', function (assert) {
assert.equal(option.getAttribute('aria-disabled'), 'true');
});
-test('options are not selected by default', function (assert) {
+QUnit.test('options are not selected by default', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
@@ -74,7 +74,7 @@ test('options are not selected by default', function (assert) {
assert.equal(option.getAttribute('aria-selected'), 'false');
});
-test('options with children are given the group role', function(assert) {
+QUnit.test('options with children are given the group role', function(assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
@@ -88,7 +88,7 @@ test('options with children are given the group role', function(assert) {
assert.equal(option.getAttribute('role'), 'group');
});
-test('options with children have the aria-label set', function (assert) {
+QUnit.test('options with children have the aria-label set', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
@@ -103,7 +103,7 @@ test('options with children have the aria-label set', function (assert) {
assert.equal(option.getAttribute('aria-label'), 'test');
});
-test('non-group options are given the option role', function (assert) {
+QUnit.test('non-group options are given the option role', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
diff --git a/tests/selection/allowClear-tests.js b/tests/selection/allowClear-tests.js
index 273f80fd..c3aa6b4f 100644
--- a/tests/selection/allowClear-tests.js
+++ b/tests/selection/allowClear-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Placeholders - Allow clear');
+QUnit.module('Selection containers - Placeholders - Allow clear');
var Placeholder = require('select2/selection/placeholder');
var AllowClear = require('select2/selection/allowClear');
@@ -23,7 +23,7 @@ var allowClearOptions = new Options({
allowClear: true
});
-test('clear is not displayed for single placeholder', function (assert) {
+QUnit.test('clear is not displayed for single placeholder', function (assert) {
var selection = new AllowClearPlaceholder(
$('#qunit-fixture .single-with-placeholder'),
allowClearOptions
@@ -42,7 +42,7 @@ test('clear is not displayed for single placeholder', function (assert) {
);
});
-test('clear is not displayed for multiple placeholder', function (assert) {
+QUnit.test('clear is not displayed for multiple placeholder', function (assert) {
var selection = new AllowClearPlaceholder(
$('#qunit-fixture .multiple'),
allowClearOptions
@@ -60,7 +60,7 @@ test('clear is not displayed for multiple placeholder', function (assert) {
});
-test('clear is displayed for placeholder', function (assert) {
+QUnit.test('clear is displayed for placeholder', function (assert) {
var selection = new AllowClearPlaceholder(
$('#qunit-fixture .single-with-placeholder'),
allowClearOptions
@@ -80,7 +80,7 @@ test('clear is displayed for placeholder', function (assert) {
);
});
-test('clear icon should have title displayed', function (assert) {
+QUnit.test('clear icon should have title displayed', function (assert) {
var selection = new AllowClearPlaceholder(
$('#qunit-fixture .single-with-placeholder'),
allowClearOptions
@@ -100,7 +100,7 @@ test('clear icon should have title displayed', function (assert) {
);
});
-test('clicking clear will set the placeholder value', function (assert) {
+QUnit.test('clicking clear will set the placeholder value', function (assert) {
var $element = $('#qunit-fixture .single-with-placeholder');
var selection = new AllowClearPlaceholder(
@@ -129,7 +129,7 @@ test('clicking clear will set the placeholder value', function (assert) {
);
});
-test('clicking clear will trigger the unselect event', function (assert) {
+QUnit.test('clicking clear will trigger the unselect event', function (assert) {
assert.expect(4);
var $element = $('#qunit-fixture .single-with-placeholder');
@@ -178,7 +178,7 @@ test('clicking clear will trigger the unselect event', function (assert) {
$remove.trigger('mousedown');
});
-test('preventing the unselect event cancels the clearing', function (assert) {
+QUnit.test('preventing the unselect event cancels the clearing', function (assert) {
var $element = $('#qunit-fixture .single-with-placeholder');
var selection = new AllowClearPlaceholder(
@@ -211,7 +211,7 @@ test('preventing the unselect event cancels the clearing', function (assert) {
);
});
-test('clicking clear will trigger the clear event', function (assert) {
+QUnit.test('clicking clear will trigger the clear event', function (assert) {
assert.expect(5);
var $element = $('#qunit-fixture .single-with-placeholder');
@@ -266,7 +266,7 @@ test('clicking clear will trigger the clear event', function (assert) {
$remove.trigger('mousedown');
});
-test('preventing the clear event cancels the clearing', function (assert) {
+QUnit.test('preventing the clear event cancels the clearing', function (assert) {
var $element = $('#qunit-fixture .single-with-placeholder');
var selection = new AllowClearPlaceholder(
@@ -299,7 +299,7 @@ test('preventing the clear event cancels the clearing', function (assert) {
);
});
-test('clear does not work when disabled', function (assert) {
+QUnit.test('clear does not work when disabled', function (assert) {
var $element = $('#qunit-fixture .single-with-placeholder');
var selection = new AllowClearPlaceholder(
@@ -330,7 +330,7 @@ test('clear does not work when disabled', function (assert) {
);
});
-test('clear button doesnt visually break selected options', function (assert) {
+QUnit.test('clear button doesnt visually break selected options', function (assert) {
var $element = $('');
var Selection = Utils.Decorate(
diff --git a/tests/selection/containerCss-tests.js b/tests/selection/containerCss-tests.js
index 522703a2..c58b53ae 100644
--- a/tests/selection/containerCss-tests.js
+++ b/tests/selection/containerCss-tests.js
@@ -1,4 +1,4 @@
-module('Dropdown - containerCssClass compatibility');
+QUnit.module('Dropdown - containerCssClass compatibility');
var $ = require('jquery');
var Utils = require('select2/utils');
@@ -10,7 +10,7 @@ var ContainerCSS = Utils.Decorate(
require('select2/compat/containerCss')
);
-test('all classes will be copied if :all: is used', function (assert) {
+QUnit.test('all classes will be copied if :all: is used', function (assert) {
var $element = $('');
var options = new Options({
containerCssClass: ':all:'
@@ -25,7 +25,7 @@ test('all classes will be copied if :all: is used', function (assert) {
assert.ok(!$container.hasClass(':all:'));
});
-test(':all: can be used with other classes', function (assert) {
+QUnit.test(':all: can be used with other classes', function (assert) {
var $element = $('');
var options = new Options({
containerCssClass: ':all: other'
@@ -41,7 +41,7 @@ test(':all: can be used with other classes', function (assert) {
assert.ok(!$container.hasClass(':all:'));
});
-test('classes can be passed in as a string', function (assert) {
+QUnit.test('classes can be passed in as a string', function (assert) {
var $element = $('');
var options = new Options({
containerCssClass: 'other'
@@ -53,7 +53,7 @@ test('classes can be passed in as a string', function (assert) {
assert.ok($container.hasClass('other'));
});
-test('a function can be used based on the element', function (assert){
+QUnit.test('a function can be used based on the element', function (assert){
var $element = $('');
var options = new Options({
containerCssClass: function ($element) {
@@ -68,7 +68,7 @@ test('a function can be used based on the element', function (assert){
assert.ok(!$container.hasClass('test'));
});
-test(':all: works around custom adapters', function (assert) {
+QUnit.test(':all: works around custom adapters', function (assert) {
var $element = $('');
var options = new Options({
containerCssClass: ':all: something',
@@ -86,9 +86,9 @@ test(':all: works around custom adapters', function (assert) {
assert.ok($container.hasClass('test-modified'));
});
-module('Selection - adaptContainerCss compatibility');
+QUnit.module('Selection - adaptContainerCss compatibility');
-test('only return when adapted', function (assert) {
+QUnit.test('only return when adapted', function (assert) {
var $element = $('');
var options = new Options({
adaptContainerCssClass: function (clazz) {
diff --git a/tests/selection/focusing-tests.js b/tests/selection/focusing-tests.js
index fcb2c6e7..f66d5d89 100644
--- a/tests/selection/focusing-tests.js
+++ b/tests/selection/focusing-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Managing focus');
+QUnit.module('Selection containers - Managing focus');
var SingleSelection = require('select2/selection/single');
@@ -7,7 +7,7 @@ var Options = require('select2/options');
var options = new Options({});
-test('close sets the focus to the selection', function (assert) {
+QUnit.test('close sets the focus to the selection', function (assert) {
var $container = $('#qunit-fixture .event-container');
var container = new MockContainer();
var selection = new SingleSelection(
diff --git a/tests/selection/multiple-tests.js b/tests/selection/multiple-tests.js
index ddc7c9c9..f681e1c5 100644
--- a/tests/selection/multiple-tests.js
+++ b/tests/selection/multiple-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Multiple');
+QUnit.module('Selection containers - Multiple');
var MultipleSelection = require('select2/selection/multiple');
@@ -8,7 +8,7 @@ var Utils = require('select2/utils');
var options = new Options({});
-test('display uses templateSelection', function (assert) {
+QUnit.test('display uses templateSelection', function (assert) {
var called = false;
var templateOptions = new Options({
@@ -33,7 +33,7 @@ test('display uses templateSelection', function (assert) {
assert.equal(out, 'test');
});
-test('templateSelection can addClass', function (assert) {
+QUnit.test('templateSelection can addClass', function (assert) {
var called = false;
var templateOptions = new Options({
@@ -62,7 +62,7 @@ test('templateSelection can addClass', function (assert) {
assert.ok($container.hasClass('testclass'));
});
-test('empty update clears the selection', function (assert) {
+QUnit.test('empty update clears the selection', function (assert) {
var selection = new MultipleSelection(
$('#qunit-fixture .multiple'),
options
@@ -82,7 +82,7 @@ test('empty update clears the selection', function (assert) {
);
});
-test('empty update clears the selection title', function (assert) {
+QUnit.test('empty update clears the selection title', function (assert) {
var selection = new MultipleSelection(
$('#qunit-fixture .multiple'),
options
@@ -101,7 +101,7 @@ test('empty update clears the selection title', function (assert) {
);
});
-test('update sets the title to the data text', function (assert) {
+QUnit.test('update sets the title to the data text', function (assert) {
var selection = new MultipleSelection(
$('#qunit-fixture .multiple'),
options
@@ -122,7 +122,7 @@ test('update sets the title to the data text', function (assert) {
);
});
-test('update sets the title to the data title', function (assert) {
+QUnit.test('update sets the title to the data title', function (assert) {
var selection = new MultipleSelection(
$('#qunit-fixture .multiple'),
options
@@ -144,7 +144,7 @@ test('update sets the title to the data title', function (assert) {
);
});
-test('update should clear title for placeholder options', function (assert) {
+QUnit.test('update should clear title for placeholder options', function (assert) {
var selection = new MultipleSelection(
$('#qunit-fixture .multiple'),
options
@@ -166,7 +166,7 @@ test('update should clear title for placeholder options', function (assert) {
);
});
-test('update should clear title for options without text', function (assert) {
+QUnit.test('update should clear title for options without text', function (assert) {
var selection = new MultipleSelection(
$('#qunit-fixture .multiple'),
options
@@ -187,7 +187,7 @@ test('update should clear title for options without text', function (assert) {
);
});
-test('escapeMarkup is being used', function (assert) {
+QUnit.test('escapeMarkup is being used', function (assert) {
var selection = new MultipleSelection(
$('#qunit-fixture .multiple'),
options
@@ -209,7 +209,7 @@ test('escapeMarkup is being used', function (assert) {
);
});
-test('clear button respects the disabled state', function (assert) {
+QUnit.test('clear button respects the disabled state', function (assert) {
var options = new Options({
disabled: true
});
diff --git a/tests/selection/placeholder-tests.js b/tests/selection/placeholder-tests.js
index 8a436ff3..82cc2b4a 100644
--- a/tests/selection/placeholder-tests.js
+++ b/tests/selection/placeholder-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Placeholders');
+QUnit.module('Selection containers - Placeholders');
var Placeholder = require('select2/selection/placeholder');
var SingleSelection = require('select2/selection/single');
@@ -16,7 +16,7 @@ var placeholderOptions = new Options({
}
});
-test('normalizing placeholder ignores objects', function (assert) {
+QUnit.test('normalizing placeholder ignores objects', function (assert) {
var selection = new SinglePlaceholder(
$('#qunit-fixture .single'),
placeholderOptions
@@ -32,7 +32,7 @@ test('normalizing placeholder ignores objects', function (assert) {
assert.equal(original, normalized);
});
-test('normalizing placeholder gives object for string', function (assert) {
+QUnit.test('normalizing placeholder gives object for string', function (assert) {
var selection = new SinglePlaceholder(
$('#qunit-fixture .single'),
placeholderOptions
@@ -45,7 +45,7 @@ test('normalizing placeholder gives object for string', function (assert) {
});
-test('text is shown for placeholder option on single', function (assert) {
+QUnit.test('text is shown for placeholder option on single', function (assert) {
var selection = new SinglePlaceholder(
$('#qunit-fixture .single'),
placeholderOptions
@@ -60,7 +60,7 @@ test('text is shown for placeholder option on single', function (assert) {
assert.equal($selection.text(), 'This is the placeholder');
});
-test('placeholder is shown when no options are selected', function (assert) {
+QUnit.test('placeholder is shown when no options are selected', function (assert) {
var selection = new SinglePlaceholder(
$('#qunit-fixture .multiple'),
placeholderOptions
diff --git a/tests/selection/search-a11y-tests.js b/tests/selection/search-a11y-tests.js
index b2628df5..c675e374 100644
--- a/tests/selection/search-a11y-tests.js
+++ b/tests/selection/search-a11y-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Inline search - Accessibility');
+QUnit.module('Selection containers - Inline search - Accessibility');
var MultipleSelection = require('select2/selection/multiple');
var InlineSearch = require('select2/selection/search');
@@ -9,7 +9,7 @@ var Utils = require('select2/utils');
var Options = require('select2/options');
var options = new Options({});
-test('role attribute is set to searchbox', function (assert) {
+QUnit.test('role attribute is set to searchbox', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
@@ -29,7 +29,7 @@ test('role attribute is set to searchbox', function (assert) {
);
});
-test('aria-autocomplete attribute is present', function (assert) {
+QUnit.test('aria-autocomplete attribute is present', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
@@ -49,7 +49,7 @@ test('aria-autocomplete attribute is present', function (assert) {
);
});
-test('aria-activedescendant should not be set initiailly', function (assert) {
+QUnit.test('aria-activedescendant should not be set initiailly', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
@@ -70,7 +70,7 @@ test('aria-activedescendant should not be set initiailly', function (assert) {
);
});
-test('aria-activedescendant should be set after highlight', function (assert) {
+QUnit.test('aria-activedescendant should be set after highlight', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
@@ -98,7 +98,7 @@ test('aria-activedescendant should be set after highlight', function (assert) {
);
});
-test('activedescendant should remove if there is no ID', function (assert) {
+QUnit.test('activedescendant should remove if there is no ID', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
@@ -124,7 +124,7 @@ test('activedescendant should remove if there is no ID', function (assert) {
);
});
-test('aria-activedescendant should be removed when closed', function (assert) {
+QUnit.test('aria-activedescendant should be removed when closed', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
@@ -148,7 +148,7 @@ test('aria-activedescendant should be removed when closed', function (assert) {
);
});
-test('aria-controls should not be set initiailly', function (assert) {
+QUnit.test('aria-controls should not be set initiailly', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
@@ -169,7 +169,7 @@ test('aria-controls should not be set initiailly', function (assert) {
);
});
-test('aria-controls should be set when opened', function (assert) {
+QUnit.test('aria-controls should be set when opened', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
@@ -192,7 +192,7 @@ test('aria-controls should be set when opened', function (assert) {
);
});
-test('aria-controls should be removed when closed', function (assert) {
+QUnit.test('aria-controls should be removed when closed', function (assert) {
var $select = $('#qunit-fixture .multiple');
var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch);
diff --git a/tests/selection/search-placeholder-tests.js b/tests/selection/search-placeholder-tests.js
index cea761ba..a80e3470 100644
--- a/tests/selection/search-placeholder-tests.js
+++ b/tests/selection/search-placeholder-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Inline search - Placeholder');
+QUnit.module('Selection containers - Inline search - Placeholder');
var MultipleSelection = require('select2/selection/multiple');
var InlineSearch = require('select2/selection/search');
@@ -13,7 +13,7 @@ var CustomSelection = Utils.Decorate(
InlineSearch
);
-test('width does not extend the search box', function (assert) {
+QUnit.test('width does not extend the search box', function (assert) {
assert.expect(2);
var $container = $(
diff --git a/tests/selection/search-tests.js b/tests/selection/search-tests.js
index 7a86cfba..1be8c6a3 100644
--- a/tests/selection/search-tests.js
+++ b/tests/selection/search-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Inline search');
+QUnit.module('Selection containers - Inline search');
var MultipleSelection = require('select2/selection/multiple');
var InlineSearch = require('select2/selection/search');
@@ -9,7 +9,7 @@ var Utils = require('select2/utils');
var options = new Options({});
-test('backspace will remove a choice', function (assert) {
+QUnit.test('backspace will remove a choice', function (assert) {
assert.expect(3);
var KEYS = require('select2/keys');
@@ -51,7 +51,7 @@ test('backspace will remove a choice', function (assert) {
$search.trigger(backspace);
});
-test('backspace will set the search text', function (assert) {
+QUnit.test('backspace will set the search text', function (assert) {
assert.expect(3);
var KEYS = require('select2/keys');
@@ -90,7 +90,7 @@ test('backspace will set the search text', function (assert) {
assert.equal($search.val(), 'One', 'The search text was set');
});
-test('updating selection does not shift the focus', function (assert) {
+QUnit.test('updating selection does not shift the focus', function (assert) {
// Check for IE 8, which triggers a false negative during testing
if (window.attachEvent && !window.addEventListener) {
// We must expect 0 assertions or the test will fail
@@ -138,7 +138,7 @@ test('updating selection does not shift the focus', function (assert) {
);
});
-test('the focus event shifts the focus', function (assert) {
+QUnit.test('the focus event shifts the focus', function (assert) {
// Check for IE 8, which triggers a false negative during testing
if (window.attachEvent && !window.addEventListener) {
// We must expect 0 assertions or the test will fail
@@ -190,7 +190,7 @@ test('the focus event shifts the focus', function (assert) {
);
});
-test('search box without text should propagate click', function (assert) {
+QUnit.test('search box without text should propagate click', function (assert) {
assert.expect(1);
var $container = $('#qunit-fixture .event-container');
@@ -218,7 +218,7 @@ test('search box without text should propagate click', function (assert) {
$search.trigger('click');
});
-test('search box with text should not propagate click', function (assert) {
+QUnit.test('search box with text should not propagate click', function (assert) {
assert.expect(0);
var $container = $('#qunit-fixture .event-container');
@@ -247,7 +247,7 @@ test('search box with text should not propagate click', function (assert) {
$search.trigger('click');
});
-test('search box with text should not close dropdown', function (assert) {
+QUnit.test('search box with text should not close dropdown', function (assert) {
assert.expect(0);
var $container = $('#qunit-fixture .event-container');
diff --git a/tests/selection/single-tests.js b/tests/selection/single-tests.js
index 99b37e66..9563afd3 100644
--- a/tests/selection/single-tests.js
+++ b/tests/selection/single-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Single');
+QUnit.module('Selection containers - Single');
var SingleSelection = require('select2/selection/single');
@@ -8,7 +8,7 @@ var Utils = require('select2/utils');
var options = new Options({});
-test('display uses templateSelection', function (assert) {
+QUnit.test('display uses templateSelection', function (assert) {
var called = false;
var templateOptions = new Options({
@@ -33,7 +33,7 @@ test('display uses templateSelection', function (assert) {
assert.equal(out, 'test');
});
-test('templateSelection can addClass', function (assert) {
+QUnit.test('templateSelection can addClass', function (assert) {
var called = false;
var templateOptions = new Options({
@@ -62,7 +62,7 @@ test('templateSelection can addClass', function (assert) {
assert.ok($container.hasClass('testclass'));
});
-test('empty update clears the selection', function (assert) {
+QUnit.test('empty update clears the selection', function (assert) {
var selection = new SingleSelection(
$('#qunit-fixture .single'),
options
@@ -82,7 +82,7 @@ test('empty update clears the selection', function (assert) {
);
});
-test('empty update clears the selection title', function (assert) {
+QUnit.test('empty update clears the selection title', function (assert) {
var selection = new SingleSelection(
$('#qunit-fixture .single'),
options
@@ -102,7 +102,7 @@ test('empty update clears the selection title', function (assert) {
);
});
-test('update renders the data text', function (assert) {
+QUnit.test('update renders the data text', function (assert) {
var selection = new SingleSelection(
$('#qunit-fixture .single'),
options
@@ -118,7 +118,7 @@ test('update renders the data text', function (assert) {
assert.equal($rendered.text(), 'test');
});
-test('update sets the title to the data text', function (assert) {
+QUnit.test('update sets the title to the data text', function (assert) {
var selection = new SingleSelection(
$('#qunit-fixture .single'),
options
@@ -138,7 +138,7 @@ test('update sets the title to the data text', function (assert) {
);
});
-test('update sets the title to the data title', function (assert) {
+QUnit.test('update sets the title to the data title', function (assert) {
var selection = new SingleSelection(
$('#qunit-fixture .single'),
options
@@ -159,7 +159,7 @@ test('update sets the title to the data title', function (assert) {
);
});
-test('update should clear title for placeholder options', function (assert) {
+QUnit.test('update should clear title for placeholder options', function (assert) {
var selection = new SingleSelection(
$('#qunit-fixture .single'),
options
@@ -182,7 +182,7 @@ test('update should clear title for placeholder options', function (assert) {
);
});
-test('update should clear title for options without text', function (assert) {
+QUnit.test('update should clear title for options without text', function (assert) {
var selection = new SingleSelection(
$('#qunit-fixture .single'),
options
@@ -204,7 +204,7 @@ test('update should clear title for options without text', function (assert) {
);
});
-test('escapeMarkup is being used', function (assert) {
+QUnit.test('escapeMarkup is being used', function (assert) {
var selection = new SingleSelection(
$('#qunit-fixture .single'),
options
diff --git a/tests/selection/stopPropagation-tests.js b/tests/selection/stopPropagation-tests.js
index d8d8897b..5dc70bc7 100644
--- a/tests/selection/stopPropagation-tests.js
+++ b/tests/selection/stopPropagation-tests.js
@@ -1,4 +1,4 @@
-module('Selection containers - Stoping event propagation');
+QUnit.module('Selection containers - Stoping event propagation');
var SingleSelection = require('select2/selection/single');
var StopPropagation = require('select2/selection/stopPropagation');
@@ -11,7 +11,7 @@ var CutomSelection = Utils.Decorate(SingleSelection, StopPropagation);
var options = new Options();
-test('click event does not propagate', function (assert) {
+QUnit.test('click event does not propagate', function (assert) {
assert.expect(1);
var $container = $('#qunit-fixture .event-container');
diff --git a/tests/utils/data-tests.js b/tests/utils/data-tests.js
index 90f0f8b9..603271b6 100644
--- a/tests/utils/data-tests.js
+++ b/tests/utils/data-tests.js
@@ -1,9 +1,9 @@
-module('Utils - RemoveData');
+QUnit.module('Utils - RemoveData');
var $ = require('jquery');
var Utils = require('select2/utils');
-test('The data-select2-id attribute is removed', function (assert) {
+QUnit.test('The data-select2-id attribute is removed', function (assert) {
var $element = $('');
Utils.RemoveData($element[0]);
@@ -15,7 +15,7 @@ test('The data-select2-id attribute is removed', function (assert) {
);
});
-test('The internal cache for the element is cleared', function (assert) {
+QUnit.test('The internal cache for the element is cleared', function (assert) {
var $element = $('');
Utils.__cache.test = {
@@ -27,7 +27,7 @@ test('The internal cache for the element is cleared', function (assert) {
assert.equal(Utils.__cache.test, null, 'The cache should now be empty');
});
-test('Calling it on an element without data works', function (assert) {
+QUnit.test('Calling it on an element without data works', function (assert) {
assert.expect(0);
var $element = $('');
diff --git a/tests/utils/decorator-tests.js b/tests/utils/decorator-tests.js
index 4888991f..a4f93a4f 100644
--- a/tests/utils/decorator-tests.js
+++ b/tests/utils/decorator-tests.js
@@ -1,8 +1,8 @@
-module('Decorators');
+QUnit.module('Decorators');
var Utils = require('select2/utils');
-test('overridden - method', function (assert) {
+QUnit.test('overridden - method', function (assert) {
function BaseClass () {}
BaseClass.prototype.hello = function () {
@@ -22,7 +22,7 @@ test('overridden - method', function (assert) {
assert.strictEqual(inst.hello(), 'B');
});
-test('overridden - constructor', function (assert) {
+QUnit.test('overridden - constructor', function (assert) {
function BaseClass () {
this.inherited = true;
}
@@ -47,7 +47,7 @@ test('overridden - constructor', function (assert) {
assert.ok(!inst.inherited);
});
-test('not overridden - method', function (assert) {
+QUnit.test('not overridden - method', function (assert) {
function BaseClass () {}
BaseClass.prototype.hello = function () {
@@ -67,7 +67,7 @@ test('not overridden - method', function (assert) {
assert.strictEqual(inst.hello(), 'A');
});
-test('not overridden - constructor', function (assert) {
+QUnit.test('not overridden - constructor', function (assert) {
function BaseClass () {
this.called = true;
}
@@ -89,7 +89,7 @@ test('not overridden - constructor', function (assert) {
assert.ok(inst.called);
});
-test('inherited - method', function (assert) {
+QUnit.test('inherited - method', function (assert) {
function BaseClass () {}
BaseClass.prototype.hello = function () {
@@ -109,7 +109,7 @@ test('inherited - method', function (assert) {
assert.strictEqual(inst.hello(), 'BAC');
});
-test('inherited - constructor', function (assert) {
+QUnit.test('inherited - constructor', function (assert) {
function BaseClass () {
this.inherited = true;
}
@@ -136,7 +136,7 @@ test('inherited - constructor', function (assert) {
assert.ok(inst.inherited);
});
-test('inherited - three levels', function (assert) {
+QUnit.test('inherited - three levels', function (assert) {
function BaseClass (testArgument) {
this.baseCalled = true;
this.baseTestArgument = testArgument;
diff --git a/tests/utils/escapeMarkup-tests.js b/tests/utils/escapeMarkup-tests.js
index 726f09de..caf779e9 100644
--- a/tests/utils/escapeMarkup-tests.js
+++ b/tests/utils/escapeMarkup-tests.js
@@ -1,15 +1,15 @@
-module('Utils - escapeMarkup');
+QUnit.module('Utils - escapeMarkup');
var Utils = require('select2/utils');
-test('text passes through', function (assert) {
+QUnit.test('text passes through', function (assert) {
var text = 'testing this';
var escaped = Utils.escapeMarkup(text);
assert.equal(text, escaped);
});
-test('html tags are escaped', function (assert) {
+QUnit.test('html tags are escaped', function (assert) {
var text = '';
var escaped = Utils.escapeMarkup(text);
@@ -17,7 +17,7 @@ test('html tags are escaped', function (assert) {
assert.equal(escaped.indexOf('