gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-backoffice] branch master updated: up to test track_


From: gnunet
Subject: [GNUnet-SVN] [taler-backoffice] branch master updated: up to test track_order() and get a XMLHttpRequest not found
Date: Tue, 09 Jan 2018 12:27:47 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new ac581d9  up to test track_order() and get a XMLHttpRequest not found
ac581d9 is described below

commit ac581d98a4f363901661b63d90f6f05fdb530b80
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Jan 9 12:27:14 2018 +0100

    up to test track_order() and get a XMLHttpRequest not found
---
 js/backoffice.js |  1 +
 js/test/main.js  | 13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/js/backoffice.js b/js/backoffice.js
index 5f37ab3..ed3792c 100644
--- a/js/backoffice.js
+++ b/js/backoffice.js
@@ -188,6 +188,7 @@ function track_order(order_id){
   }
   req.send();
 }
+module.exports.track_order = track_order;
 
 function xpath_get(xpath, ctx){
   var ret = document.evaluate(xpath,
diff --git a/js/test/main.js b/js/test/main.js
index 7f5a85b..777c020 100644
--- a/js/test/main.js
+++ b/js/test/main.js
@@ -5,6 +5,15 @@ var document = global.document = {};
 document.addEventListener = function(){};
 const bo = require("../backoffice");
 
-ava.test("back-office is responsive", (t) => {
+ava.test("orders tracking", (t) => {
+  var xhr = sinon.useFakeXMLHttpRequest();
+  var requests = [];
+  xhr.onCreate = function(xhr){
+    requests.push(xhr);
+  };
+
+  bo.track_order(22); // Throws: XMLHttpRequest is not defined.
+
+  xhr.restore();
   t.pass();
-})
+});

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]