Tests inspect mkws.config rather than old mkws_config
[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     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(/^(\/|https?:\/\/)/)
35     });
36 });
37
38 describe("Check pazpar2 runtime", function () {
39     it("pazpar2 was successfully initialized", function () {
40         expect(mkws.config.error).toBe(undefined);
41     });
42 });