diff options
| author | Trey Hunner <trey@treyhunner.com> | 2015-04-14 10:55:57 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-06-30 21:04:16 -0400 |
| commit | 2d0dead224b6448072b72b37d2fbcc8dc3afa007 (patch) | |
| tree | 6dfb01a60cefc0dcf5cdcb35ac5c946a2cab98e0 /js_tests/admin/SelectFilter2.test.js | |
| parent | 3bbaf84d6533fb61ac0038f2bbe52ee0d7b4fd10 (diff) | |
DEP 0003 -- Added JavaScript unit tests.
Setup QUnit, added tests, and measured test coverage.
Thanks to Nick Sanford for the initial tests.
Diffstat (limited to 'js_tests/admin/SelectFilter2.test.js')
| -rw-r--r-- | js_tests/admin/SelectFilter2.test.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js_tests/admin/SelectFilter2.test.js b/js_tests/admin/SelectFilter2.test.js new file mode 100644 index 0000000000..a06c3ab49c --- /dev/null +++ b/js_tests/admin/SelectFilter2.test.js @@ -0,0 +1,14 @@ +module('admin.SelectFilter2'); + +test('init', function(assert) { + var $ = django.jQuery; + $('<form><select id="id"></select></form>').appendTo('#qunit-fixture'); + $('<option value="0">A</option>').appendTo('#id'); + SelectFilter.init('id', 'things', 0); + assert.equal($('.selector-available h2').text().trim(), "Available things"); + assert.equal($('.selector-chosen h2').text().trim(), "Chosen things"); + assert.equal($('.selector-chooseall').text(), "Choose all"); + assert.equal($('.selector-add').text(), "Choose"); + assert.equal($('.selector-remove').text(), "Remove"); + assert.equal($('.selector-clearall').text(), "Remove all"); +}); |
