b6852a967f3d0e203bab3699180d3c6d1018650c
[mkws-moved-to-github.git] / test / spec / mkws-config.js
1 /* Copyright (c) 2013-2014 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     /*
22      * this is a test if the config value is a boolean JavaScript object: true or false
23      * and nothing else (0, '0', undefined, "false" etc.)
24      */
25     it("mkws.config service proxy enabled/disabled", function () {
26         if (mkws.config.use_service_proxy) {
27             expect(mkws.config.use_service_proxy).toBe(true);
28         } else {
29             expect(mkws.config.use_service_proxy).toBe(false);
30         }
31     });
32
33 });
34
35
36 describe("Check pazpar2 config", function () {
37     it("pazpar2_url is a path or an full URL", function () {
38         expect(mkws.config.pazpar2_url).toMatch(/^(\/|https?:\/\/|undefined$)/)
39     });
40 });
41
42 describe("Check pazpar2 runtime", function () {
43     it("pazpar2 was successfully initialized", function () {
44         expect(mkws.config.error).toBe(undefined);
45     });
46 });