Commit d1f6bc3a authored by Boris Kocherov's avatar Boris Kocherov

tests: qunit update 2.3.0

parent 4fb21029
......@@ -4,10 +4,10 @@
<title>Test JSON form</title>
<meta name="viewport" content="width=device-width, height=device-height"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../node_modules/grunt-contrib-qunit/test/libs/qunit.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" type="text/css" media="screen"/>
<script src="../rsvp.js" type="text/javascript"></script>
<script src="../renderjs.js" type="text/javascript"></script>
<script src="../node_modules/grunt-contrib-qunit/test/libs/qunit.js" type="text/javascript"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js" type="text/javascript"></script>
<script src="../node_modules/sinon/pkg/sinon.js" type="text/javascript"></script>
<script src="jsonform_test.js" type="text/javascript"></script>
</head>
......
......@@ -3,18 +3,9 @@
(function (document, renderJS, QUnit) {
"use strict";
var test = QUnit.test,
stop = QUnit.stop,
start = QUnit.start,
ok = QUnit.ok,
expect = QUnit.expect,
// equal = QUnit.equal,
// throws = QUnit.throws,
// deepEqual = QUnit.deepEqual,
module = QUnit.module,
// notEqual = QUnit.notEqual,
root_gadget_defer = RSVP.defer(),
jsonform_url = '../jsonform.gadget.html';
window.module = undefined;
// Keep track of the root gadget
renderJS(window)
......@@ -26,32 +17,33 @@
// declareGadget
/////////////////////////////////////////////////////////////////
module("jsonform.declareGadget", {
setup: function () {
beforeEach: function () {
renderJS.clearGadgetKlassList();
}
});
test('JSON Form gadget can be loaded', function () {
stop();
expect(1);
test('JSON Form gadget can be loaded', function (assert) {
var done = assert.async();
assert.expect(1);
root_gadget_defer.promise
.then(function (root_gadget) {
return root_gadget.declareGadget(
jsonform_url,
{
scope: "iframe",
element: document.querySelector('#qunit-fixture')
}
);
})
.then(function (gadget) {
ok(true, gadget);
assert.ok(true, gadget);
})
.fail(function (error) {
ok(false, error);
assert.ok(false, error);
console.warn(error);
throw error;
})
.always(function () {
start();
done();
});
});
......
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