Check for external JavaScript libs, part of MKWS-341
[mkws-moved-to-github.git] / test / spec / mkws-config.js
index 4cba621..c1963d2 100644 (file)
@@ -1,9 +1,30 @@
-/* Copyright (c) 2013-2014 IndexData ApS. http://indexdata.com
+/* Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
  *
  * check mkws_config = {} object in browser
  *
  */
 
+describe("Check for external JavaScript libs", function () {
+    it("JSNlog", function () {
+        expect(typeof JL).not.toBe('undefined');
+    });
+
+    it("Handlebars", function () {
+        expect(typeof Handlebars).not.toBe('undefined');
+    });
+
+    it("jQuery", function () {
+        expect(typeof mkws.$).not.toBe('undefined');
+    });
+
+    xit("jQuery UI", function () {
+        // if we have a popup widget, check for the jQuery UI lib
+        if ($(".popup").length > 0) {
+            expect(typeof mkws.$.ui).not.toBe('undefined');
+        }
+    });
+});
+
 describe("Check mkws.config object", function () {
     it("mkws.config exists", function () {
         expect(mkws.config).not.toBe(undefined);
@@ -35,7 +56,7 @@ describe("Check mkws.config object", function () {
 
 describe("Check pazpar2 config", function () {
     it("pazpar2_url is a path or an full URL", function () {
-        expect(mkws.config.pazpar2_url).toMatch(/^(\/|https?:\/\/)/)
+        expect(mkws.config.pazpar2_url).toMatch(/^(\/|https?:\/\/|undefined$)/)
     });
 });