writing tests for htmlEntities function
This commit is contained in:
parent
67f71f4dd6
commit
f699ca6cd4
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)));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ if ($MARKDOWN):
|
|||||||
<?php
|
<?php
|
||||||
endif;
|
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]>
|
<!--[if lt IE 10]>
|
||||||
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
|
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
@ -47,7 +47,7 @@ if ($MARKDOWN):
|
|||||||
<?php
|
<?php
|
||||||
endif;
|
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]>
|
<!--[if lt IE 10]>
|
||||||
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
|
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
Loading…
Reference in New Issue
Block a user