1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

[3.1.x] Refs #31493 -- Replaced var with const/let in documentation JS.

Backport of 2afa61e7d9 from master
This commit is contained in:
Adam Johnson
2020-06-24 11:41:10 +02:00
committed by Carlton Gibson
parent b8cb14e8a0
commit 6ed4a9bdb3
4 changed files with 34 additions and 25 deletions

View File

@@ -82,13 +82,13 @@ Django's JavaScript tests use `QUnit`_. Here is an example test module:
QUnit.module('magicTricks', {
beforeEach: function() {
var $ = django.jQuery;
const $ = django.jQuery;
$('#qunit-fixture').append('<button class="button"></button>');
}
});
QUnit.test('removeOnClick removes button on click', function(assert) {
var $ = django.jQuery;
const $ = django.jQuery;
removeOnClick('.button');
assert.equal($('.button').length, 1);
$('.button').click();
@@ -96,7 +96,7 @@ Django's JavaScript tests use `QUnit`_. Here is an example test module:
});
QUnit.test('copyOnClick adds button on click', function(assert) {
var $ = django.jQuery;
const $ = django.jQuery;
copyOnClick('.button');
assert.equal($('.button').length, 1);
$('.button').click();