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("JSNlog", function () {
9 expect(typeof JL).not.toBe('undefined');
12 it("Handlebars", function () {
13 expect(typeof Handlebars).not.toBe('undefined');
16 it("jQuery", function () {
17 expect(typeof mkws.$).not.toBe('undefined');
20 it("jQuery UI", function () {
21 // if we have a popup widget, check for the jQuery UI lib
22 if (mkws.$(".popup").length > 0) {
23 expect(typeof mkws.$.ui).not.toBe('undefined');
28 describe("Check mkws.config object", function () {
29 it("mkws.config exists", function () {
30 expect(mkws.config).not.toBe(undefined);
33 it("mkws.config locale check German", function () {
34 expect(mkws.locale_lang.de.Authors).toMatch(/^Autoren$/);
35 expect(mkws.locale_lang.de.Location).toMatch(/^Ort$/);
37 it("mkws.config locale check Danish", function () {
38 expect(mkws.locale_lang.da.Authors).toMatch(/^Forfattere$/);
39 expect(mkws.locale_lang.da.Location).toMatch(/^Lokation$/);
43 * this is a test if the config value is a boolean JavaScript object: true or false
44 * and nothing else (0, '0', undefined, "false" etc.)
46 it("mkws.config service proxy enabled/disabled", function () {
47 if (mkws.config.use_service_proxy) {
48 expect(mkws.config.use_service_proxy).toBe(true);
50 expect(mkws.config.use_service_proxy).toBe(false);
57 describe("Check pazpar2 config", function () {
58 it("pazpar2_url is a path or an full URL", function () {
59 expect(mkws.config.pazpar2_url).toMatch(/^(\/|https?:\/\/|undefined$)/)
63 describe("Check pazpar2 runtime", function () {
64 it("pazpar2 was successfully initialized", function () {
65 expect(mkws.config.error).toBe(undefined);