diff --git a/core/misc/tests/drupal.test.js b/core/misc/tests/drupal.test.js new file mode 100644 index 0000000..a4f274d --- /dev/null +++ b/core/misc/tests/drupal.test.js @@ -0,0 +1,15 @@ +const assert = require('assert'); +const jsdom = require('jsdom'); +domready = function () {}; +Drupal = {}; +const _ = require('../drupal.es6'); + +describe('Drupal', function () { + describe('#checkPlain()', function () { + it('should escape html strings safe for printing', function () { + const html = 'Rock & roll'; + const escaped = '<span class="music">Rock & roll</span>'; + assert.strictEqual(Drupal.checkPlain(html), escaped, 'Drupal.checkPlain escape HTML strings'); + }); + }); +});