Commit d30cceba authored by Ivan Tyagov's avatar Ivan Tyagov

Extend test for TabularGadget so no API regressions happens silently.

Clean up.
parent 2aaacd10
...@@ -609,7 +609,7 @@ var RenderJs = (function () { ...@@ -609,7 +609,7 @@ var RenderJs = (function () {
* Read this list from data structure created in HTML5 local * Read this list from data structure created in HTML5 local
* storage by updateGadgetIndexFromURL * storage by updateGadgetIndexFromURL
*/ */
// XXX: get from Cache stored index and itterate over it // get from Cache stored index and itterate over it
// to find matching ones // to find matching ones
var gadget_list = []; var gadget_list = [];
$.each(RenderJs.GadgetCatalog.getGadgetIndexUrlList(), $.each(RenderJs.GadgetCatalog.getGadgetIndexUrlList(),
...@@ -729,8 +729,3 @@ var RenderJs = (function () { ...@@ -729,8 +729,3 @@ var RenderJs = (function () {
}()) }())
}; };
}()); }());
\ No newline at end of file
// impliticly call RenderJs bootstrap
// $(document).ready(function () {
// RenderJs.init();
// });
...@@ -105,6 +105,21 @@ function setupRenderJSTest(){ ...@@ -105,6 +105,21 @@ function setupRenderJSTest(){
}); });
}); });
module("TabularGadget");
test('addTabularGadget', function () {
cleanUp();
equal(RenderJs.GadgetIndex.getGadgetList().length, 0);
RenderJs.TabbularGadget.addNewTabGadget("qunit-fixture", "new_added", "loading/test-gadget.html", "", "");
stop();
RenderJs.bindReady(function (){
start();
equal($("#qunit-fixture").children("#new_added").length, 1);
equal(RenderJs.GadgetIndex.getGadgetList().length, 1);
equal(RenderJs.GadgetIndex.getRootGadget().getDom().attr("id"), "new_added");
});
});
module("GadgetInitialization"); module("GadgetInitialization");
test('GadgetInitialization', function () { test('GadgetInitialization', function () {
cleanUp(); cleanUp();
......
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