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)));
}
);
});
});

View File

@ -69,7 +69,7 @@ if ($MARKDOWN):
<?php
endif;
?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-RbM1let1vUccPguggBRaKCuVkfyje+lMaZuoLJ9nuCBlULVkgxvJ6XCoQTSOOxdQvDRJ2j1u2DYQFoKA6sqPQg==" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-HujncUuaZgVgfPmJ1dyHyH+kjYOH/UWW88cla+CgU6s/ncGOvo/+such9ikwKqa0/JGcHnLYlONVjt2L7oM5kA==" crossorigin="anonymous"></script>
<!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]-->

View File

@ -47,7 +47,7 @@ if ($MARKDOWN):
<?php
endif;
?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-RbM1let1vUccPguggBRaKCuVkfyje+lMaZuoLJ9nuCBlULVkgxvJ6XCoQTSOOxdQvDRJ2j1u2DYQFoKA6sqPQg==" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-HujncUuaZgVgfPmJ1dyHyH+kjYOH/UWW88cla+CgU6s/ncGOvo/+such9ikwKqa0/JGcHnLYlONVjt2L7oM5kA==" crossorigin="anonymous"></script>
<!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]-->