Commit d1f6bc3a authored by Boris Kocherov's avatar Boris Kocherov

tests: qunit update 2.3.0

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