aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/index.html1
-rw-r--r--js/tests/unit/util.js19
2 files changed, 20 insertions, 0 deletions
diff --git a/js/tests/index.html b/js/tests/index.html
index 2383fce6e..0385b8a2b 100644
--- a/js/tests/index.html
+++ b/js/tests/index.html
@@ -119,6 +119,7 @@
<script src="unit/tab.js"></script>
<script src="unit/tooltip.js"></script>
<script src="unit/popover.js"></script>
+ <script src="unit/util.js"></script>
</head>
<body>
<div id="qunit-container">
diff --git a/js/tests/unit/util.js b/js/tests/unit/util.js
new file mode 100644
index 000000000..c3412041e
--- /dev/null
+++ b/js/tests/unit/util.js
@@ -0,0 +1,19 @@
+$(function () {
+ 'use strict'
+
+ QUnit.module('Util')
+
+ QUnit.test('Util.jQuery should find window.jQuery if window.$ is not available', function (assert) {
+ assert.expect(1)
+ delete window.$
+ assert.strictEqual(Util.jQuery, window.jQuery)
+ window.$ = Util.jQuery
+ })
+
+ QUnit.test('Util.jQuery should find window.$ if window.jQuery is not available', function (assert) {
+ assert.expect(1)
+ delete window.jQuery
+ assert.strictEqual(Util.jQuery, window.$)
+ window.jQuery = Util.jQuery
+ })
+})