From 1ef8b30abed6ecf0c28517001e7fd8a84e6e47d3 Mon Sep 17 00:00:00 2001 From: weijunji <990628wjy@gmail.com> Date: Tue, 19 Dec 2017 03:49:00 +0800 Subject: [PATCH] Fixed #28929 -- Corrected QUnit examples. --- .../contributing/writing-code/javascript.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/internals/contributing/writing-code/javascript.txt b/docs/internals/contributing/writing-code/javascript.txt index 54f05da20a..5d96e19e25 100644 --- a/docs/internals/contributing/writing-code/javascript.txt +++ b/docs/internals/contributing/writing-code/javascript.txt @@ -81,27 +81,27 @@ Django's JavaScript tests use `QUnit`_. Here is an example test module: .. code-block:: javascript - module('magicTricks', { + QUnit.module('magicTricks', { beforeEach: function() { var $ = django.jQuery; $('#qunit-fixture').append(''); } }); - test('removeOnClick removes button on click', function(assert) { + QUnit.test('removeOnClick removes button on click', function(assert) { var $ = django.jQuery; removeOnClick('.button'); - assert.equal($('.button').length === 1); + assert.equal($('.button').length, 1); $('.button').click(); - assert.equal($('.button').length === 0); + assert.equal($('.button').length, 0); }); - test('copyOnClick adds button on click', function(assert) { + QUnit.test('copyOnClick adds button on click', function(assert) { var $ = django.jQuery; copyOnClick('.button'); - assert.equal($('.button').length === 1); + assert.equal($('.button').length, 1); $('.button').click(); - assert.equal($('.button').length === 2); + assert.equal($('.button').length, 2); });