run with pp2 and sp
[mkws-moved-to-github.git] / test / spec / mkws-config.js
1 /* Copyright (c) 2013 IndexData ApS. http://indexdata.com
2  *
3  * check mkws_config = {} object in browser
4  *
5  */
6
7 describe("Check mkws_config object", function () {
8     it("mkws_config exists", function () {
9         expect(mkws_config).not.toBe(undefined);
10     });
11
12     it("mkws_config locale check German", function () {
13         expect(mkws.locale_lang.de.Authors).toMatch(/^Autoren$/);
14         expect(mkws.locale_lang.de.Location).toMatch(/^Ort$/);
15     });
16     it("mkws_config locale check Danish", function () {
17         expect(mkws.locale_lang.da.Authors).toMatch(/^Forfattere$/);
18         expect(mkws.locale_lang.da.Location).toMatch(/^Lokation$/);
19     });
20
21     it("mkws_config service proxy enabled/disabled", function () {
22         if (mkws_config.use_service_proxy) {
23             expect(mkws_config.use_service_proxy).toBe(true);
24         } else {
25             expect(mkws_config.use_service_proxy).toBe(false);
26         }
27     });
28
29 });
30
31
32 describe("Check pazpar2 config", function () {
33     it("pazpar2path is a path or an full URL", function () {
34         expect(mkws_config.pazpar2_url).toMatch(/^(\/|http:\/\/)/)
35     });
36
37     it("Check usesessions true/false", function () {
38         if (mkws_config.use_service_proxy) {
39             expect(mkws.usesessions).toBe(false);
40         } else {
41             expect(mkws.usesessions).toBe(true);
42         }
43     });
44
45     it("my_paz is defined", function () {
46         expect(mkws.my_paz).not.toBe(undefined);
47     });
48 });
49
50 describe("Check pazpar2 runtime", function () {
51     it("pazpar2 was successfully initialize", function () {
52         expect(mkws_config.error).toBe(undefined);
53     });
54 });