1 /* Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
3 * check mkws_config = {} object in browser
7 describe("Check for external JavaScript libs", function () {
8 it("jQuery", function () {
9 expect(typeof mkws.$).not.toBe('undefined');
13 it("jQuery JSON", function () {
14 expect(typeof mkws.$.toJSON).not.toBe('undefined');
17 it("jQuery UI", function () {
18 // if we have a popup widget, check for the jQuery UI lib
19 if (mkws.$(".mkws-popup").length > 0) {
20 expect(typeof mkws.$.ui).not.toBe('undefined');
24 it("pazpar2", function () {
25 expect(typeof pz2).not.toBe('undefined');
28 it("JSNlog", function () {
29 expect(typeof JL).not.toBe('undefined');
32 it("Handlebars", function () {
33 expect(typeof Handlebars).not.toBe('undefined');
37 describe("Check mkws.config object", function () {
38 it("mkws.config exists", function () {
39 expect(mkws.config).not.toBe(undefined);
42 it("mkws.config locale check German", function () {
43 expect(mkws.locale_lang.de.Authors).toMatch(/^Autoren$/);
44 expect(mkws.locale_lang.de.Location).toMatch(/^Ort$/);
46 it("mkws.config locale check Danish", function () {
47 expect(mkws.locale_lang.da.Authors).toMatch(/^Forfattere$/);
48 expect(mkws.locale_lang.da.Location).toMatch(/^Lokation$/);
52 * this is a test if the config value is a boolean JavaScript object: true or false
53 * and nothing else (0, '0', undefined, "false" etc.)
55 it("mkws.config service proxy enabled/disabled", function () {
56 if (mkws.config.use_service_proxy) {
57 expect(mkws.config.use_service_proxy).toBe(true);
59 expect(mkws.config.use_service_proxy).toBe(false);
66 describe("Check pazpar2 config", function () {
67 it("pazpar2_url is a path or an full URL", function () {
68 expect(mkws.config.pazpar2_url).toMatch(/^(\/|https?:\/\/|undefined$)/)
72 describe("Check pazpar2 runtime", function () {
73 it("pazpar2 was successfully initialized", function () {
74 expect(mkws.config.error).toBe(undefined);