Commit 6d43204c authored by Romain Courteaud's avatar Romain Courteaud

Fix gadget methods default values.

parent 3c7624d6
......@@ -20,14 +20,13 @@
declareJavascript,
methods;
function RenderJSGadget() {
this.title = "";
this.interface_list = [];
this.path = "";
this.html = "";
this.required_css_list = [];
this.required_js_list = [];
}
function RenderJSGadget() {}
RenderJSGadget.prototype.title = "";
RenderJSGadget.prototype.interface_list = [];
RenderJSGadget.prototype.path = "";
RenderJSGadget.prototype.html = "";
RenderJSGadget.prototype.required_css_list = [];
RenderJSGadget.prototype.required_js_list = [];
// Returns the list of gadget prototype
RenderJSGadget.prototype.getInterfaceList = function () {
......
......@@ -755,6 +755,19 @@
});
});
test('default value', function () {
// Check that getInterfaceList return a Promise
var gadget = new RenderJSGadget();
stop();
gadget.getInterfaceList()
.done(function (result) {
deepEqual(result, []);
})
.always(function () {
start();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getRequiredCSSList
/////////////////////////////////////////////////////////////////
......@@ -773,6 +786,19 @@
});
});
test('default value', function () {
// Check that getRequiredCSSList return a Promise
var gadget = new RenderJSGadget();
stop();
gadget.getRequiredCSSList()
.done(function (result) {
deepEqual(result, []);
})
.always(function () {
start();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getRequiredJSList
/////////////////////////////////////////////////////////////////
......@@ -791,11 +817,24 @@
});
});
test('default value', function () {
// Check that getRequiredJSList return a Promise
var gadget = new RenderJSGadget();
stop();
gadget.getRequiredJSList()
.done(function (result) {
deepEqual(result, []);
})
.always(function () {
start();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getPath
/////////////////////////////////////////////////////////////////
module("RenderJSGadget.getPath");
test('returns interface_list', function () {
test('returns path', function () {
// Check that getPath return a Promise
var gadget = new RenderJSGadget();
gadget.path = "foo";
......@@ -809,11 +848,24 @@
});
});
test('default value', function () {
// Check that getPath return a Promise
var gadget = new RenderJSGadget();
stop();
gadget.getPath()
.done(function (result) {
equal(result, "");
})
.always(function () {
start();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getTitle
/////////////////////////////////////////////////////////////////
module("RenderJSGadget.getTitle");
test('returns interface_list', function () {
test('returns title', function () {
// Check that getTitle return a Promise
var gadget = new RenderJSGadget();
gadget.title = "foo";
......@@ -827,11 +879,24 @@
});
});
test('default value', function () {
// Check that getTitle return a Promise
var gadget = new RenderJSGadget();
stop();
gadget.getTitle()
.done(function (result) {
equal(result, "");
})
.always(function () {
start();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getHTML
/////////////////////////////////////////////////////////////////
module("RenderJSGadget.getHTML");
test('returns interface_list', function () {
test('returns html', function () {
// Check that getHTML return a Promise
var gadget = new RenderJSGadget();
gadget.html = "foo";
......@@ -845,4 +910,17 @@
});
});
test('default value', function () {
// Check that getHTML return a Promise
var gadget = new RenderJSGadget();
stop();
gadget.getHTML()
.done(function (result) {
equal(result, "");
})
.always(function () {
start();
});
});
}(document, jQuery, renderJS, QUnit, sinon));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment