Commits

David Chambers committed 05e7436

add tests for HTML escaping

Comments (0)

Files changed (1)

   assert.equal($1.localize('%%%%').text(), '%%');
   assert.equal($1.localize('~~P').text(), '~~P');
 
+  // HTML escaping
+  var abbrDays = '<<<<<<<'.split(/(?=&)/);
+  assert.equal(
+    $1.localize({format: 'ddd', abbrDays: abbrDays, escaped: false}).html(),
+    '<');
+  assert.equal(
+    $1.localize({format: 'ddd', abbrDays: abbrDays, escaped: false}).text(),
+    '<');
+  assert.equal(
+    $1.localize({format: 'ddd', abbrDays: abbrDays, escaped: true}).html(),
+    '<');
+  assert.equal(
+    $1.localize({format: 'ddd', abbrDays: abbrDays, escaped: true}).text(),
+    '<');
+
   // direct custom function usage
   $1.localize(function (date) {
     assert.instanceOf(this, jQuery);