writing tests for htmlEntities function

This commit is contained in:
El RIDO 2017-02-05 18:46:24 +01:00
parent 67f71f4dd6
commit f699ca6cd4
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
3 changed files with 17 additions and 2 deletions

View file

@ -140,5 +140,20 @@ describe('helper', function () {
}
);
});
describe('htmlEntities', function () {
after(function () {
cleanup();
});
jsc.property(
'removes all HTML entities from any given string',
'string',
function (string) {
var result = $.PrivateBin.helper.htmlEntities(string);
return !(/[<>"'`=\/]/.test(result)) && !(string.indexOf('&') > -1 && !(/&amp;/.test(result)));
}
);
});
});