summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-09-04 16:20:34 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-09-04 16:20:34 +0200
commit78f28f53eac7ac5c3f1dbd6f94f619f8f216339c (patch)
tree22b8925ff1c841c4e5cb4e7d9f3711b779dccd33
parent565d73912ec63c0307a01aa9a2554e6998d27df5 (diff)
downloadbackoffice-78f28f53eac7ac5c3f1dbd6f94f619f8f216339c.tar.gz
backoffice-78f28f53eac7ac5c3f1dbd6f94f619f8f216339c.tar.bz2
backoffice-78f28f53eac7ac5c3f1dbd6f94f619f8f216339c.zip
mocking values for tests
-rw-r--r--js/test/main.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/js/test/main.js b/js/test/main.js
index 0a8505f..edebe86 100644
--- a/js/test/main.js
+++ b/js/test/main.js
@@ -46,13 +46,17 @@ ava.test.beforeEach(t => {
global.XMLHttpRequest = t.context.xhr;};
function minor_mocks() {
var document = {};
+ document.createElement = ()=>
+ {return {innerHTML: "",
+ setAttribute: function(a, b){}}};
document.addEventListener = ()=>{};
document.getElementsByClassName = ()=>
{return [{style: {visibility: "hidden"}}]};
document.getElementById = ()=>
/* pacifies code that attempts
* to change this property anyway. */
- {return {style: {visibility: "hidden"}}};
+ {return {style: {visibility: "hidden"},
+ appendChild: function(a){}}};
global.document = document;
global.alert = console.log;
// disable logging for tests