mirror of https://github.com/django/django.git
Added JavaScript tests for contrib.admin's URLify.js.
This commit is contained in:
parent
7acbe89cc2
commit
68812ba868
|
@ -0,0 +1,21 @@
|
|||
/* global QUnit, URLify */
|
||||
/* eslint global-strict: 0, strict: 0 */
|
||||
'use strict';
|
||||
|
||||
QUnit.module('admin.URLify');
|
||||
|
||||
QUnit.test('empty string', function(assert) {
|
||||
assert.strictEqual(URLify('', 8, true), '');
|
||||
});
|
||||
|
||||
QUnit.test('strip nonessential words', function(assert) {
|
||||
assert.strictEqual(URLify('the D is silent', 8, true), 'd-silent');
|
||||
});
|
||||
|
||||
QUnit.test('strip non-URL characters', function(assert) {
|
||||
assert.strictEqual(URLify('D#silent@', 7, true), 'dsilent');
|
||||
});
|
||||
|
||||
QUnit.test('merge adjacent whitespace', function(assert) {
|
||||
assert.strictEqual(URLify('D silent', 8, true), 'd-silent');
|
||||
});
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
<script src="./qunit/qunit.js"></script>
|
||||
|
||||
<script src='../django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.min.js'></script>
|
||||
<script src='../django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js'></script>
|
||||
<script src='../django/contrib/admin/static/admin/js/jquery.init.js'></script>
|
||||
<script src='./admin/jsi18n-mocks.test.js'></script>
|
||||
|
@ -76,6 +77,7 @@
|
|||
<script src='../django/contrib/admin/static/admin/js/collapse.js' data-cover></script>
|
||||
<script src='../django/contrib/admin/static/admin/js/prepopulate.js' data-cover></script>
|
||||
<script src='../django/contrib/admin/static/admin/js/urlify.js' data-cover></script>
|
||||
<script src='./admin/URLify.test.js'></script>
|
||||
|
||||
<div id="id_point_map" style="display:none;">
|
||||
<textarea id="id_point" name="point" class="vSerializedField required"
|
||||
|
|
Loading…
Reference in New Issue