blob: 387032487a73d3019446a2bfd9e8068f26489674 [file] [log] [blame]
Akrond48e0952018-11-30 13:01:18 +01001define(['view/result/koralquery','util'], function (kqClass) {
2 describe('KorAP.View.Result.KoralQuery', function () {
3
4 beforeEach(
5 function () {
6 KorAP.koralQuery = {}
7 }
8 );
9
10 afterEach(
11 function () {
12 KorAP.koralQuery = {}
13 }
14 );
15
16 it('should be initializable', function () {
17 KorAP.koralQuery = {
18 "test" : "cool"
19 };
20 var kq = kqClass.create();
21 var content = kq.element().firstChild.textContent;
22 expect(content).toMatch(/test/);
23 expect(content).toMatch(/cool/);
24 });
25
26 it('should deal with XML fragments', function () {
27 KorAP.koralQuery = {
28 "test" : "Das ist <b>Super!</b>"
29 };
30 var kq = kqClass.create();
31 var content = kq.element().firstChild.textContent;
32 expect(content).toMatch(/test/);
33 expect(content).toMatch(/Das ist <b>Super!<\/b>/);
34 });
35
36 });
37});