diff --git a/js_tests/admin/URLify.test.js b/js_tests/admin/URLify.test.js new file mode 100644 index 0000000000..b1d7d1f301 --- /dev/null +++ b/js_tests/admin/URLify.test.js @@ -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'); +}); diff --git a/js_tests/tests.html b/js_tests/tests.html index 63e56bb52a..d2a361ad75 100644 --- a/js_tests/tests.html +++ b/js_tests/tests.html @@ -43,6 +43,7 @@ + @@ -76,6 +77,7 @@ +