writing tests for htmlEntities function

This commit is contained in:
El RIDO
2017-02-05 18:46:24 +01:00
parent 67f71f4dd6
commit f699ca6cd4
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)));
}
);
});
});