From: Krzysztof Antoszek Date: Wed, 10 Apr 2013 10:04:04 +0000 (+0200) Subject: ensurens: qunit tests X-Git-Tag: accepted/tizen_2.1/20130425.023924~1^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6eeb19c9d7c1022d310a93c6fbc34305883ffed6;p=platform%2Fframework%2Fweb%2Fweb-ui-fw.git ensurens: qunit tests Change-Id: Ifd09b2d6d01059b66f719ffee11e3a1bd575a7e8 --- diff --git a/tests/unit-tests/ensurens/ensurens-tests.js b/tests/unit-tests/ensurens/ensurens-tests.js new file mode 100644 index 0000000..af00393 --- /dev/null +++ b/tests/unit-tests/ensurens/ensurens-tests.js @@ -0,0 +1,34 @@ +/* + * Unit Test: EnsureNS + * + * Krzysztof Antoszek + */ + + +$(document).ready(function () { + module("ensureNS"); + test("ensureNS test", function () { + var obj = { + "prop1": true, + "prop2": 1 + }; + + // # TEST 1 + equal(!!(window.ensure && window.ensure.tests && window.ensure.tests.leaf1), false); + + ensureNS('window.ensure.tests.leaf1'); + + // # TEST 2 + equal(!!(window.ensure && window.ensure.tests && window.ensure.tests.leaf1), true); + + window.ensure.tests.leaf1 = obj; + + ensureNS('window.ensure.tests.leaf1.leaf2'); + + // # TEST 3 + equal(typeof window.ensure.tests.leaf1.leaf2, "object"); + + // # TEST 4 + deepEqual(window.ensure.tests.leaf1, obj); + }); +}); \ No newline at end of file diff --git a/tests/unit-tests/ensurens/index.html b/tests/unit-tests/ensurens/index.html new file mode 100644 index 0000000..4958c84 --- /dev/null +++ b/tests/unit-tests/ensurens/index.html @@ -0,0 +1,25 @@ + + + + + + + + + + + ensureNS + + + +

Extendablelist

+

+
+

+
    + +
    + + diff --git a/tests/unit-tests/tests.js b/tests/unit-tests/tests.js index e560f77..af64589 100755 --- a/tests/unit-tests/tests.js +++ b/tests/unit-tests/tests.js @@ -1,6 +1,7 @@ var TESTS = { "testPages":[ // Put your test here + "ensurens", "button", "core", "check",