mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-21 22:18:58 -04:00
writing tests for htmlEntities function
This commit is contained in:
parent
67f71f4dd6
commit
f699ca6cd4
3 changed files with 17 additions and 2 deletions
15
js/test.js
15
js/test.js
|
@ -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 && !(/&/.test(result)));
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue