Commit 168e032d authored by Thibaut Frain's avatar Thibaut Frain

update path to gadget in tests to pass test suite in erp5

parent bbdf5cf2
......@@ -14,7 +14,7 @@ QUnit.config.testTimeout = 1000;
//expect = QUnit.expect,
//throws = QUnit.throws,
//deepEqual = QUnit.deepEqual;
bwGadgetURL = '../deploy/gadget/bootstrap-wysiwyg.html';
bwGadgetURL = '../src/gadget/bootstrap-wysiwyg.html';
function iframeSelector(selectorString) {
return $('iframe').contents().find(selectorString);
......
......@@ -10,7 +10,7 @@ QUnit.config.testTimeout = 1000;
start = QUnit.start,
ok = QUnit.ok,
equal = QUnit.equal,
jqsGadgetURL = '../deploy/gadget/jqs.html';
jqsGadgetURL = '../src/gadget/jqs.html';
function iframeSelector(selectorString) {
return $('iframe').contents().find(selectorString);
......@@ -25,7 +25,7 @@ QUnit.config.testTimeout = 1000;
var g = rJS(this),
gadget_context = g.context.find('#gadget').first();
asyncTest("jquery.sheet loading : sheet loads", 2, function () {
asyncTest("(iframe) jquery.sheet loading: sheet loads", 2, function () {
var c0r0 = buildSelector(0,0,0);
var c1r1 = buildSelector(0,1,1);
......@@ -37,7 +37,7 @@ QUnit.config.testTimeout = 1000;
.always(start);
});
asyncTest("jquery.sheet loading : sheet is empty", 2, function () {
asyncTest("(iframe) jquery.sheet loading: sheet is empty", 2, function () {
var c0r0 = buildSelector(0,0,0);
var c1r1 = buildSelector(0,1,1);
......@@ -49,7 +49,7 @@ QUnit.config.testTimeout = 1000;
.always(start);
});
asyncTest("clear content", 2, function () {
asyncTest("(iframe) clear content", 2, function () {
var c0r0 = buildSelector(0,0,0);
var c1r1 = buildSelector(0,1,1);
......@@ -68,7 +68,7 @@ QUnit.config.testTimeout = 1000;
.always(start);
});
asyncTest("get content of sheet", 2, function () {
asyncTest("(iframe) get content of sheet", 2, function () {
var c0r0 = buildSelector(0,0,0);
var c1r1 = buildSelector(0,1,1);
......@@ -88,7 +88,7 @@ QUnit.config.testTimeout = 1000;
.always(start);
});
asyncTest("set content of sheet", 4, function () {
asyncTest("(iframe) set content of sheet", 4, function () {
var gadget, content,
t0c0r0 = buildSelector(0,0,0),
t0c1r1 = buildSelector(0,1,1),
......@@ -118,6 +118,100 @@ QUnit.config.testTimeout = 1000;
.always(start);
});
asyncTest("jquery.sheet loading : sheet loads", 2, function () {
var c0r0 = buildSelector(0,0,0);
var c1r1 = buildSelector(0,1,1);
g.declareGadget(jqsGadgetURL, gadget_context)
.then(function () {
ok($(c0r0).length != 0);
ok($(c1r1).length != 0);
})
.always(start);
});
asyncTest("jquery.sheet loading: sheet is empty", 2, function () {
var c0r0 = buildSelector(0,0,0);
var c1r1 = buildSelector(0,1,1);
g.declareIframedGadget(jqsGadgetURL, gadget_context)
.then(function () {
equal($(c0r0).html(),"");
equal($(c1r1).html(),"");
})
.always(start);
});
asyncTest("clear content", 2, function () {
var c0r0 = buildSelector(0,0,0);
var c1r1 = buildSelector(0,1,1);
g.declareIframedGadget(jqsGadgetURL, gadget_context)
.then(function (gadget) {
$(c0r0).html('c0r0Value');
$(c1r1).html('c1r1Value');
return gadget;
})
.then(function (gadget) {
return gadget.clearContent().then(function () {
equal($(c0r0).text(),"");
equal($(c1r1).text(),"");
});
})
.always(start);
});
asyncTest("get content of sheet", 2, function () {
var c0r0 = buildSelector(0,0,0);
var c1r1 = buildSelector(0,1,1);
g.declareIframedGadget(jqsGadgetURL, gadget_context)
.then(function (gadget) {
$(c0r0).html('c0r0Value');
$(c1r1).html('c1r1Value');
return gadget;
})
.then(function (gadget) {
return gadget.getContent().then(function (content) {
var json = JSON.parse(content)[0];
equal(json.data.r0.c0.value,"c0r0Value");
equal(json.data.r1.c1.value,"c1r1Value");
});
})
.always(start);
});
asyncTest("set content of sheet", 4, function () {
var gadget, content,
t0c0r0 = buildSelector(0,0,0),
t0c1r1 = buildSelector(0,1,1),
t2c0r0 = buildSelector(2,0,0),
t2c1r1 = buildSelector(2,1,1);
g.declareIframedGadget(jqsGadgetURL, gadget_context)
.then(function (gd) {
$(t0c0r0).html('c0r0Value');
$(t0c1r1).html('c1r1Value');
gadget = gd;
return gadget.getContent();
})
.then(function (c) {
content = c;
return gadget.clearContent();
})
.then(function () {
equal($(t0c0r0).text(),"");
equal($(t2c1r1).text(),"");
return gadget.setContent(content);
})
.then(function () {
equal($(t2c0r0).text(),"c0r0Value");
equal($(t2c1r1).text(),"c1r1Value");
})
.always(start);
});
});
} (window, jQuery, QUnit, rJS));
......@@ -13,7 +13,7 @@ class OFFICEJSTest(TestCase):
"""
Launch officejs test without requirejs
"""
root_directory = __file__[0:-len("parts/officejs/test_launcher_for_officejs/tests/testOfficeJS.py")]
root_directory = __file__[0:-len("/parts/officejs/test_launcher_for_officejs/tests/testOfficeJS.py")]
command = ["%s %s %s; exit 0" % (
'%s/bin/phantomjs' % root_directory,
'%s/parts/officejs/test/run-qunit.js' % root_directory,
......
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