mirror of
https://github.com/django/django.git
synced 2025-11-01 12:25:37 +00:00
Added JavaScript tests for contrib.admin's URLify.js.
This commit is contained in:
parent
7acbe89cc2
commit
68812ba868
2 changed files with 23 additions and 0 deletions
21
js_tests/admin/URLify.test.js
Normal file
21
js_tests/admin/URLify.test.js
Normal file
|
|
@ -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');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue