diff --git a/js/test/InitialCheck.js b/js/test/InitialCheck.js new file mode 100644 index 0000000..30aba1a --- /dev/null +++ b/js/test/InitialCheck.js @@ -0,0 +1,31 @@ +'use strict'; +var common = require('../common'); + +describe('InitialCheck', function () { + describe('init', function () { + this.timeout(30000); + before(function () { + cleanup(); + }); + + jsc.property( + 'returns false and shows error, if a bot UA is detected', + 'string', + jsc.elements(['Bot', 'bot']), + 'string', + function ( + prefix, botBit, suffix + ) { + const clean = jsdom( + '', + {'userAgent': prefix + botBit + suffix} + ); + var result1 = $.PrivateBin.InitialCheck.init(), + result2 = !$('#errormessage').hasClass('hidden'); + clean(); + return result1 && result2; + } + ); + }); +}); +