From 4004c9b260e3addb73af04f2b763cae571d09bc7 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Tue, 20 Jan 2015 17:11:13 +0100 Subject: [PATCH] Simple test for the tuskar.boxes_progress Change-Id: Iefd934c042cfceb079094edfda9526621c9a4eeb --- .../tests/tuskar.boxes_progress.js | 27 +++++++++++++++++++ .../templates/tuskar_boxes/qunit.html | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 tuskar_boxes/static/tuskar_boxes/tests/tuskar.boxes_progress.js diff --git a/tuskar_boxes/static/tuskar_boxes/tests/tuskar.boxes_progress.js b/tuskar_boxes/static/tuskar_boxes/tests/tuskar.boxes_progress.js new file mode 100644 index 0000000..6b9a349 --- /dev/null +++ b/tuskar_boxes/static/tuskar_boxes/tests/tuskar.boxes_progress.js @@ -0,0 +1,27 @@ + +horizon.addInitFunction(function () { + "use strict"; + + module("Tuskar boxes progress (tuskar.boxes_progress.js)"); + + test("update_progress", function () { + var data = { + "nodes": [{ + "uuid": "I'm sorry, Dave.", + "cpu_arch": "HAL 9000", + "role_slug": "exterminate", + "state_slug": "smug", + "node_title": "I'm afraid I can't do that.", + "cpus": 1, + "memory_mb": 0, + "local_gb": 1000, + "state_icon": "fa-circle-o" + }] + }; + + tuskar.boxes_progress.update_progress(data); + + // No logic to test here, just make sure the function runs without errors. + expect(0); + }); +}); diff --git a/tuskar_boxes/templates/tuskar_boxes/qunit.html b/tuskar_boxes/templates/tuskar_boxes/qunit.html index 6a5b4b6..d2df987 100644 --- a/tuskar_boxes/templates/tuskar_boxes/qunit.html +++ b/tuskar_boxes/templates/tuskar_boxes/qunit.html @@ -9,6 +9,7 @@ {% comment %}Load test modules here.{% endcomment %} + {% comment %}End test modules.{% endcomment %} {% include "horizon/_scripts.html" %} @@ -22,7 +23,6 @@

    -
    @@ -74,5 +74,6 @@
    + {% include "tuskar_boxes/overview/_node_info_js.html" %}