expect(OC.dirname('/subdir/')).toEqual('/subdir');
});
});
+ describe('escapeHTML', function() {
+ it('Returns nothing if no string was given', function() {
+ expect(escapeHTML('')).toEqual('');
+ });
+ it('Returns a sanitized string if a string containing HTML is given', function() {
+ expect(escapeHTML('There needs to be a <script>alert(\"Unit\" + \'test\')</script> for it!')).toEqual('There needs to be a <script>alert("Unit" + 'test')</script> for it!');
+ });
+ it('Returns the string without modification if no potential dangerous character is passed.', function() {
+ expect(escapeHTML('This is a good string without HTML.')).toEqual('This is a good string without HTML.');
+ });
+ });
describe('Link functions', function() {
var TESTAPP = 'testapp';
var TESTAPP_ROOT = OC.webroot + '/appsx/testapp';