summaryrefslogtreecommitdiff
path: root/js_tests/admin/actions.test.js
diff options
context:
space:
mode:
authorTrey Hunner <trey@treyhunner.com>2015-04-14 10:55:57 -0400
committerTim Graham <timograham@gmail.com>2015-06-30 21:04:16 -0400
commit2d0dead224b6448072b72b37d2fbcc8dc3afa007 (patch)
tree6dfb01a60cefc0dcf5cdcb35ac5c946a2cab98e0 /js_tests/admin/actions.test.js
parent3bbaf84d6533fb61ac0038f2bbe52ee0d7b4fd10 (diff)
downloaddjango-2d0dead224b6448072b72b37d2fbcc8dc3afa007.tar.gz
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/actions.test.js')
-rw-r--r--js_tests/admin/actions.test.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js_tests/admin/actions.test.js b/js_tests/admin/actions.test.js
new file mode 100644
index 0000000000..01e9267b94
--- /dev/null
+++ b/js_tests/admin/actions.test.js
@@ -0,0 +1,18 @@
+module('admin.actions', {
+ beforeEach: function() {
+ // Number of results shown on page
+ window._actions_icnt = '100';
+
+ var $ = django.jQuery;
+ $('#qunit-fixture').append($('#result-table').text());
+
+ $('tr input.action-select').actions();
+ }
+});
+
+test('check', function(assert) {
+ var $ = django.jQuery;
+ assert.notOk($('.action-select').is(':checked'));
+ $('#action-toggle').click();
+ assert.ok($('.action-select').is(':checked'));
+});