blob: d10aced1cf91609b5b1436fac6a223aa681d9bca [file] [log] [blame]
Nils Diewald7c8ced22015-04-15 19:21:00 +00001// Regarding async:
2// http://stackoverflow.com/questions/16423156/getting-requirejs-to-work-with-jasmine
Akrond8692de2018-07-26 13:06:01 +02003define(['match',
4 'view/match/tokentable',
5 'view/match/relations',
6 'panel/match',
7 'match/meta',
8 'match/infolayer',
9 'match/treeitem',
10 'match/treearc',
Akron3bdac532019-03-04 13:24:43 +010011 'match/treehierarchy',
Akrond8692de2018-07-26 13:06:01 +020012 'buttongroup/menu',
Akrona0ea3c32018-12-14 18:33:48 +010013 'match/attachement',
Akrond8692de2018-07-26 13:06:01 +020014 'hint/foundries/cnx',
15 'hint/foundries/mate'], function (
16 matchClass,
17 tableClass,
18 relClass,
19 panelClass,
20 metaClass,
21 infoClass,
22 matchTreeItemClass,
23 matchRelClass,
Akron3bdac532019-03-04 13:24:43 +010024 matchHierClass,
Akrona0ea3c32018-12-14 18:33:48 +010025 matchTreeMenuClass,
26 attachementClass) {
Nils Diewald7c8ced22015-04-15 19:21:00 +000027
Akrond8692de2018-07-26 13:06:01 +020028 var available = [
29 'base/s=spans',
30 'corenlp/c=spans',
31 'corenlp/ne=tokens',
32 'corenlp/p=tokens',
33 'corenlp/s=spans',
34 'glemm/l=tokens',
35 'mate/l=tokens',
36 'mate/m=tokens',
37 'mate/p=tokens',
38 'opennlp/p=tokens',
39 'opennlp/s=spans',
40 'tt/l=tokens',
41 'tt/p=tokens',
42 'tt/s=spans'
43 ];
Nils Diewalda297f062015-04-02 00:23:46 +000044
Akrond8692de2018-07-26 13:06:01 +020045 var match = {
46 'corpusID' : 'WPD',
47 'docID' : 'UUU',
48 'textID' : '01912',
49 'matchID' : 'p121-122',
50 'textSigle' : 'WPD/UUU/01912',
51 'available' : available
Nils Diewalda297f062015-04-02 00:23:46 +000052 };
Akrond8692de2018-07-26 13:06:01 +020053
54
55 var fields = [
56 {
57 "@type": "koral:field",
58 "key": "author",
59 "type": "type:text",
60 "value": "Sprachpfleger, u.a."
61 },
62 {
63 "@type": "koral:field",
64 "key": "textClass",
Akrond45a1702018-11-19 18:15:17 +010065 "type": "type:keywords", // May not be necessary
Akrond8692de2018-07-26 13:06:01 +020066 "value": ["kultur", "film"]
67 },
68 {
69 "@type":"koral:field",
70 "key":"foundries",
71 "type":"type:string",
72 "value":[
73 "corenlp",
74 "corenlp\/constituency",
75 "corenlp\/morpho",
76 "corenlp\/sentences",
77 "dereko",
78 "dereko\/structure",
79 "dereko\/structure\/base-sentences-paragraphs-pagebreaks",
80 "opennlp",
81 "opennlp\/morpho",
82 "opennlp\/sentences"
83 ]
Akrona0ea3c32018-12-14 18:33:48 +010084 },
85 {
86 "@type": "koral:field",
87 "key": "xlink",
88 "type": "type:attachement",
89 "value": "data:application/x.korap-link;title=Cool,https://de.wikipedia.org/wiki/Beispiel"
90 },
Akrond3bb85b2019-02-08 10:15:13 +010091 {
92 "@type": "koral:field",
93 "key": "z-reference",
94 "type": "type:attachement",
95 "value": "data:,This is a reference"
96 }
Akrond8692de2018-07-26 13:06:01 +020097 ];
98
99
100 var snippet = "<span title=\"cnx/l:meist\">" +
101 " <span title=\"cnx/p:ADV\">" +
102 " <span title=\"cnx/syn:@PREMOD\">" +
103 " <span title=\"mate/l:meist\">" +
104 " <span title=\"mate/l:meist\">" +
105 " <span title=\"mate/p:ADV\">" +
106 " <span title=\"opennlp/p:ADV\">meist</span>" +
107 " </span>" +
108 " </span>" +
109 " </span>" +
110 " </span>" +
111 " </span>" +
112 "</span>" +
Akronad1e46a2018-09-19 15:55:40 +0200113 "<mark>" +
Akrond8692de2018-07-26 13:06:01 +0200114 "<span title=\"cnx/l:deutlich\">" +
115 " <span title=\"cnx/p:A\">" +
116 " <span title=\"cnx/syn:@PREMOD\">" +
117 " <span title=\"mate/l:deutlich\">" +
118 " <span title=\"mate/m:degree:pos\">" +
119 " <span title=\"mate/p:ADJD\">" +
120 " <span title=\"opennlp/p:ADJD\">deutlich</span>" +
121 " </span>" +
122 " </span>" +
123 " </span>" +
124 " </span>" +
125 " </span>" +
126 "</span>" +
Akronad1e46a2018-09-19 15:55:40 +0200127 "</mark>" +
Akrond8692de2018-07-26 13:06:01 +0200128 "<span title=\"cnx/l:fähig\">" +
129 " <span title=\"cnx/l:leistung\">" +
130 " <span title=\"cnx/p:A\">" +
131 " <span title=\"cnx/p:ADJA\">" +
132 " <span title=\"cnx/syn:@NH\">" +
133 " <span title=\"mate/l:leistungsfähig\">" +
134 " <span title=\"mate/m:degree:comp\">" +
135 " <span title=\"mate/p:ADJD\">" +
136 " <span title=\"opennlp/p:ADJD\">leistungsfähiger</span>" +
137 " </span>" +
138 " </span>" +
139 " </span>" +
140 " </span>" +
141 " </span>" +
142 " </span>" +
143 " </span>" +
144 "</span>";
145
146 var treeSnippet =
147 "<span class=\"context-left\"></span>" +
148 "<span class=\"match\">" +
149 " <span title=\"xip/c:MC\">" +
150 " <span title=\"xip/c:TOP\">" +
151 " <span title=\"xip/c:PP\">" +
152 " <span title=\"xip/c:PREP\">Mit</span>" +
153 " <span title=\"xip/c:NP\">" +
154 " <span title=\"xip/c:DET\">dieser</span>" +
155 " <span title=\"xip/c:NPA\">" +
156 " <span title=\"xip/c:NOUN\">Methode</span>" +
157 " </span>" +
158 " </span>" +
159 " </span>" +
160 " <span title=\"xip/c:VERB\">ist</span>" +
161 " <mark>" +
162 " <span title=\"xip/c:NP\">" +
163 " <span title=\"xip/c:PRON\">es</span>" +
164 " </span>" +
165 " <span title=\"xip/c:AP\">" +
166 " <span title=\"xip/c:ADV\">nun</span>" +
167 " <span title=\"xip/c:ADJ\">möglich</span>" +
168 " </span>" +
169 " </mark>" +
170 " <span title=\"xip/c:ADV\">z. B.</span>" +
171 " <span title=\"xip/c:NPA\">" +
172 " <span title=\"xip/c:NP\">" +
173 " <span title=\"xip/c:NOUN\">Voice</span>" +
174 " </span>" +
175 " </span>" + "(" +
176 " <span title=\"xip/c:INS\">" +
177 " <span title=\"xip/c:NPA\">" +
178 " <span title=\"xip/c:NP\">" +
179 " <span title=\"xip/c:NOUN\">Sprache</span>" +
180 " </span>" +
181 " </span>" +
182 " </span>" + ")" +
183 " <span title=\"xip/c:VERB\">bevorzugt</span>" +
184 " <span title=\"xip/c:PP\">" +
185 " <span title=\"xip/c:PREP\">in</span>" +
186 " <span title=\"xip/c:NP\">" +
187 " <span title=\"xip/c:PRON\">der</span>" +
188 " </span>" +
189 " <span title=\"xip/c:NPA\">" +
190 " <span title=\"xip/c:NP\">" +
191 " <span title=\"xip/c:NOUN\">Bridge</span>" +
192 " </span>" +
193 " </span>" +
194 " </span>" +
195 " <span title=\"xip/c:INFC\">" +
196 " <span title=\"xip/c:INS\">" +
197 " <span title=\"xip/c:VERB\">weiterzugeben</span>" +
198 " </span>" +
199 " </span>" +
200 " </span>" +
201 " </span>" +
202 "</span>" +
203 "<span class=\"context-right\"></span>";
204
Akron3bdac532019-03-04 13:24:43 +0100205 var treeSnippetHierarchy =
206 "<span class=\"context-left\"><\/span><span class=\"match\"><span title=\"corenlp\/c:MPN\">Leonard Maltin<\/span> schrieb: „<span title=\"corenlp\/c:S\"><span title=\"corenlp\/c:NP\">Plot <span title=\"corenlp\/c:MPN\">contrivance isn‘<mark>t<\/mark> handled badly<\/span><\/span> <span title=\"corenlp\/c:PP\">in above-average programmer<\/span><\/span>“.&lt;<span title=\"corenlp\/c:S\"><span title=\"corenlp\/c:ROOT\"><span title=\"corenlp\/c:NP\">ref&gt;''<span title=\"corenlp\/c:NP\"><span title=\"corenlp\/c:CNP\">Movie &amp;amp; Video<\/span> Guide<\/span><\/span>'', <span title=\"corenlp\/c:VP\">1996 edition, <span title=\"corenlp\/c:NP\"><span title=\"corenlp\/c:CNP\">S. 210<\/span><\/span><\/span>.<\/span><\/span><\/span><span class=\"context-right\"><\/span>";
Akrond8692de2018-07-26 13:06:01 +0200207
Akron3bdac532019-03-04 13:24:43 +0100208 function matchElementFactory () {
Akrond8692de2018-07-26 13:06:01 +0200209 var me = document.createElement('li');
210
211 me.setAttribute(
212 'data-available-info',
213 'base/s=spans corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens' +
214 ' corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens' +
215 ' mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens' +
216 ' tt/p=tokens tt/s=spans');
217
218 me.setAttribute('data-corpus-id', 'WPD');
219 me.setAttribute('data-doc-id', 'FFF');
220 me.setAttribute('data-text-id', '01460');
221 me.setAttribute('data-text-sigle', 'WPD/FFF/01460');
222 me.setAttribute('data-match-id', 'p119-120');
223 me.innerHTML = '<div><div class="snippet">check</div></div><p class="ref">me</p>';
224 return me;
225 };
226
227 function matchElementReal () {
228 var me = document.createElement('em');
229 me.innerHTML =
230 '<li data-match-id="p85183-85184"' +
231 ' data-text-sigle="GOE/AGI/00000"' +
232 ' data-available-info="base/s=spans corenlp/c=spans corenlp/p=tokens corenlp/s=spans dereko/s=spans malt/d=rels opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans"' +
233 ' data-info="{&quot;UID&quot;:0,&quot;author&quot;:&quot;Goethe, Johann Wolfgang von&quot;,&quot;corpusID&quot;:null,&quot;corpusSigle&quot;:&quot;GOE&quot;,&quot;docID&quot;:null,&quot;docSigle&quot;:&quot;GOE\/AGI&quot;,&quot;layerInfos&quot;:&quot;base\/s=spans corenlp\/c=spans corenlp\/p=tokens corenlp\/s=spans dereko\/s=spans malt\/d=rels opennlp\/p=tokens opennlp\/s=spans tt\/l=tokens tt\/p=tokens tt\/s=spans&quot;,&quot;matchID&quot;:&quot;match-GOE\/AGI\/00000-p85183-85184&quot;,&quot;pubDate&quot;:&quot;1982&quot;,&quot;pubPlace&quot;:&quot;München&quot;,&quot;subTitle&quot;:&quot;Auch ich in Arkadien!&quot;,&quot;textID&quot;:null,&quot;textSigle&quot;:&quot;GOE\/AGI\/00000&quot;,&quot;title&quot;:&quot;Italienische Reise&quot;}"' +
234 ' id="GOE/AGI/00000#p85183-85184">' +
235 '<div>' +
236 '<div class="flag"></div>' +
237 '<div class="snippet startMore endMore"><span class="context-left"><span class="more"></span>keine großen Flächen, aber sanft gegeneinander laufende Berg- und Hügelrücken, durchgängig mit Weizen und Gerste bestellt, die eine ununterbrochene Masse von Fruchtbarkeit dem Auge darbieten. der diesen Pflanzen geeignete Boden wird so genutzt und so geschont, daß man nirgends einen </span><span class="match"><mark>Baum</mark></span><span class="context-right"> sieht, ja, alle die kleinen Ortschaften und Wohnungen liegen auf Rücken der Hügel, wo eine hinstreichende Reihe Kalkfelsen den Boden ohnehin unbrauchbar macht. dort wohnen die Weiber das ganze Jahr, mit Spinnen und Weben beschäftigt, die Männer hingegen bringen zur<span class="more"></span></span></div>' +
238 '</div>' +
239 '<p class="ref"><strong>Italienische Reise</strong> von Goethe, Johann Wolfgang von (<time datetime="1982">1982</time>) <span class="sigle">[GOE/AGI/00000]</span> </p>' +
240 '</li>';
241 return me.firstChild;
242 };
243
244 var beforeAllFunc = function () {
245 // Override getMatchInfo API call
246 KorAP.API.getMatchInfo = function (x, param, cb) {
247 if (param['spans'] === undefined || param['spans'] === false)
248 cb({ "snippet": snippet });
249 else
250 cb({ "snippet": treeSnippet });
251 };
252 };
253
254 var afterAllFunc = function () {
255 KorAP.API.getMatchInfo = undefined;
256 // KorAP.annotationHelper = undefined;
257 var body = document.body;
258 for (var i in body.children) {
259 if (body.children[i].nodeType && body.children[i].nodeType === 1) {
260 if (!body.children[i].classList.contains("jasmine_html-reporter")) {
261 body.removeChild(body.children[i]);
262 };
263 };
264 };
265 };
266
Akron671fdb92017-09-12 18:09:46 +0200267
Nils Diewald7c8ced22015-04-15 19:21:00 +0000268 describe('KorAP.InfoLayer', function () {
Akrond8692de2018-07-26 13:06:01 +0200269 beforeAll(beforeAllFunc);
270 afterAll(afterAllFunc);
Nils Diewalda297f062015-04-02 00:23:46 +0000271
Nils Diewald7c8ced22015-04-15 19:21:00 +0000272 it('should be initializable', function () {
273 expect(
Akron671fdb92017-09-12 18:09:46 +0200274 function() { infoClass.create() }
Nils Diewald7c8ced22015-04-15 19:21:00 +0000275 ).toThrow(new Error("Missing parameters"));
Nils Diewalda297f062015-04-02 00:23:46 +0000276
Nils Diewald7c8ced22015-04-15 19:21:00 +0000277 expect(
Akron671fdb92017-09-12 18:09:46 +0200278 function() { infoClass.create("base") }
Nils Diewald7c8ced22015-04-15 19:21:00 +0000279 ).toThrow(new Error("Missing parameters"));
Nils Diewalda297f062015-04-02 00:23:46 +0000280
Nils Diewald7c8ced22015-04-15 19:21:00 +0000281 var layer = infoClass.create("base", "s");
282 expect(layer).toBeTruthy();
283 expect(layer.foundry).toEqual("base");
284 expect(layer.layer).toEqual("s");
285 expect(layer.type).toEqual("tokens");
Nils Diewalda297f062015-04-02 00:23:46 +0000286
Nils Diewald7c8ced22015-04-15 19:21:00 +0000287 layer = infoClass.create("cnx", "syn", "spans");
288 expect(layer).toBeTruthy();
289 expect(layer.foundry).toEqual("cnx");
290 expect(layer.layer).toEqual("syn");
291 expect(layer.type).toEqual("spans");
Nils Diewald58141332015-04-07 16:18:45 +0000292 });
293 });
Nils Diewalda297f062015-04-02 00:23:46 +0000294
Nils Diewalda297f062015-04-02 00:23:46 +0000295
Nils Diewald7c8ced22015-04-15 19:21:00 +0000296 describe('KorAP.Match', function () {
Akrond8692de2018-07-26 13:06:01 +0200297 beforeAll(beforeAllFunc);
298 afterAll(afterAllFunc);
299
Nils Diewald7c8ced22015-04-15 19:21:00 +0000300 var match = {
301 'corpusID' : 'WPD',
302 'docID' : 'UUU',
303 'textID' : '01912',
304 'matchID' : 'p121-122',
Akron0a6768f2016-07-13 18:00:43 +0200305 'textSigle' : 'WPD/UUU/01912',
Nils Diewald7c8ced22015-04-15 19:21:00 +0000306 'available' : available
307 };
308
Nils Diewald7c8ced22015-04-15 19:21:00 +0000309 it('should be initializable by Object', function () {
310 expect(function() {
Akron671fdb92017-09-12 18:09:46 +0200311 matchClass.create()
Nils Diewald7c8ced22015-04-15 19:21:00 +0000312 }).toThrow(new Error('Missing parameters'));
313
314 expect(matchClass.create(match)).toBeTruthy();
315
316 var m = matchClass.create(match);
Akron0a6768f2016-07-13 18:00:43 +0200317 expect(m.textSigle).toEqual("WPD/UUU/01912");
Nils Diewald7c8ced22015-04-15 19:21:00 +0000318 expect(m.matchID).toEqual("p121-122");
319
320 // /corpus/WPD/UUU.01912/p121-122/matchInfo?spans=false&foundry=*
321 var m = matchClass.create(match);
322
323 // Spans:
324 var spans = m.getSpans();
325 expect(spans[0].foundry).toEqual("base");
326 expect(spans[0].layer).toEqual("s");
327
328 expect(spans[1].foundry).toEqual("corenlp");
329 expect(spans[1].layer).toEqual("c");
330
331 expect(spans[2].foundry).toEqual("corenlp");
332 expect(spans[2].layer).toEqual("s");
333
334 expect(spans[spans.length-1].foundry).toEqual("tt");
335 expect(spans[spans.length-1].layer).toEqual("s");
336
337 // Tokens:
338 var tokens = m.getTokens();
339 expect(tokens[0].foundry).toEqual("corenlp");
340 expect(tokens[0].layer).toEqual("ne");
341
342 expect(tokens[1].foundry).toEqual("corenlp");
343 expect(tokens[1].layer).toEqual("p");
344
345 expect(tokens[tokens.length-1].foundry).toEqual("tt");
346 expect(tokens[tokens.length-1].layer).toEqual("p");
Nils Diewald58141332015-04-07 16:18:45 +0000347 });
Nils Diewalda297f062015-04-02 00:23:46 +0000348
349
Akroncdb0baa2016-11-07 01:52:11 +0100350 it('should be initializable by Node 1', function () {
Nils Diewald7c8ced22015-04-15 19:21:00 +0000351 var m = matchClass.create(matchElementFactory());
Akron0a6768f2016-07-13 18:00:43 +0200352 expect(m.textSigle).toEqual("WPD/FFF/01460");
Nils Diewald7c8ced22015-04-15 19:21:00 +0000353 expect(m.matchID).toEqual("p119-120");
Nils Diewalda297f062015-04-02 00:23:46 +0000354
Nils Diewald7c8ced22015-04-15 19:21:00 +0000355 // Spans:
356 var spans = m.getSpans();
357 expect(spans[0].foundry).toEqual("base");
358 expect(spans[0].layer).toEqual("s");
Nils Diewalda297f062015-04-02 00:23:46 +0000359
Nils Diewald7c8ced22015-04-15 19:21:00 +0000360 expect(spans[1].foundry).toEqual("corenlp");
361 expect(spans[1].layer).toEqual("c");
Nils Diewalda297f062015-04-02 00:23:46 +0000362
Nils Diewald7c8ced22015-04-15 19:21:00 +0000363 expect(spans[2].foundry).toEqual("corenlp");
364 expect(spans[2].layer).toEqual("s");
Nils Diewalda297f062015-04-02 00:23:46 +0000365
Nils Diewald7c8ced22015-04-15 19:21:00 +0000366 expect(spans[spans.length-1].foundry).toEqual("tt");
367 expect(spans[spans.length-1].layer).toEqual("s");
Nils Diewalda297f062015-04-02 00:23:46 +0000368
Nils Diewald7c8ced22015-04-15 19:21:00 +0000369 // Tokens:
370 var tokens = m.getTokens();
371 expect(tokens[0].foundry).toEqual("corenlp");
372 expect(tokens[0].layer).toEqual("ne");
Nils Diewalda297f062015-04-02 00:23:46 +0000373
Nils Diewald7c8ced22015-04-15 19:21:00 +0000374 expect(tokens[1].foundry).toEqual("corenlp");
375 expect(tokens[1].layer).toEqual("p");
Nils Diewalda297f062015-04-02 00:23:46 +0000376
Nils Diewald7c8ced22015-04-15 19:21:00 +0000377 expect(tokens[tokens.length-1].foundry).toEqual("tt");
378 expect(tokens[tokens.length-1].layer).toEqual("p");
Nils Diewalda297f062015-04-02 00:23:46 +0000379
Nils Diewald7c8ced22015-04-15 19:21:00 +0000380 });
Nils Diewalda297f062015-04-02 00:23:46 +0000381
Akroncdb0baa2016-11-07 01:52:11 +0100382 it('should be initializable by Node 2', function () {
383 var ele = matchElementReal();
384 var m = matchClass.create(ele);
385 expect(m.textSigle).toEqual("GOE/AGI/00000");
386 expect(m.matchID).toEqual("p85183-85184");
387 });
388
389
Nils Diewald7c8ced22015-04-15 19:21:00 +0000390 it('should react to gui actions', function () {
391 var e = matchElementFactory();
Nils Diewalda297f062015-04-02 00:23:46 +0000392
Nils Diewald7c8ced22015-04-15 19:21:00 +0000393 expect(e.classList.contains('active')).toBe(false);
394 expect(e["_match"]).toBe(undefined);
Nils Diewalda297f062015-04-02 00:23:46 +0000395
Nils Diewald7c8ced22015-04-15 19:21:00 +0000396 var m = matchClass.create(e);
397
398 expect(e.classList.contains('active')).toBe(false);
399 expect(e["_match"]).not.toBe(undefined);
400
401 // Open the match
402 m.open();
403
404 expect(e.classList.contains('active')).toBe(true);
405 expect(e["_match"]).not.toBe(undefined);
406
Akronbfe912c2018-07-17 19:30:52 +0200407 actions = e.querySelector("p.ref > div.action.button-group").children;
Akrond141a362018-07-10 18:12:13 +0200408
Akronbfe912c2018-07-17 19:30:52 +0200409 expect(actions[0].getAttribute("class")).toEqual("metatable");
Akronc296ca22018-04-24 16:35:26 +0200410 expect(actions[1].getAttribute("class")).toEqual("info");
411 expect(actions[2].getAttribute("class")).toEqual("tree");
412
Nils Diewald7c8ced22015-04-15 19:21:00 +0000413 // Close the match
Akronec6bb8e2018-08-29 13:07:56 +0200414 m.minimize();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000415 expect(e.classList.contains('active')).toBe(false);
416 expect(e["_match"]).not.toBe(undefined);
Nils Diewald58141332015-04-07 16:18:45 +0000417 });
Nils Diewalda297f062015-04-02 00:23:46 +0000418
Akrond8692de2018-07-26 13:06:01 +0200419 it('should open tree menu', function () {
Akronc296ca22018-04-24 16:35:26 +0200420 var e = matchElementFactory();
421 var m = matchClass.create(e);
422 m.open();
Akronbfe912c2018-07-17 19:30:52 +0200423 var relation = e.querySelector("p.ref > div.action.button-group > span:nth-of-type(3)");
Akronc296ca22018-04-24 16:35:26 +0200424 expect(relation.getAttribute("class")).toEqual("tree");
Akron52ed22d2018-07-11 17:05:19 +0200425 expect(document.getElementsByClassName("button-group-list").length).toEqual(0);
Akronc296ca22018-04-24 16:35:26 +0200426
427 expect(document.activeElement.tagName).toEqual("BODY");
428
429 // Show menu
430 relation.click();
Akron52ed22d2018-07-11 17:05:19 +0200431 expect(document.getElementsByClassName("button-group-list").length).toEqual(1);
Akronc296ca22018-04-24 16:35:26 +0200432
433 expect(document.activeElement.tagName).toEqual("UL");
434
435 // Choose first tree
Akron52ed22d2018-07-11 17:05:19 +0200436 document.getElementsByClassName("button-group-list")[0].getElementsByTagName("li")[1].click();
Akronc296ca22018-04-24 16:35:26 +0200437 expect(e.querySelector("div.matchinfo div.matchtree h6 span").innerText).toEqual("corenlp");
438
439 // This should blur the focus
440 expect(document.activeElement.tagName).toEqual("BODY");
441 });
442
443 });
Nils Diewald7c8ced22015-04-15 19:21:00 +0000444
Akron7f9a6a32018-07-18 15:05:23 +0200445 describe('KorAP.TableView', function () {
Akrond8692de2018-07-26 13:06:01 +0200446 beforeAll(beforeAllFunc);
447 afterAll(afterAllFunc);
448
Akron7f9a6a32018-07-18 15:05:23 +0200449 var table;
Nils Diewald7c8ced22015-04-15 19:21:00 +0000450
Akron7f9a6a32018-07-18 15:05:23 +0200451 var matchObj = matchClass.create(match);
452 var tableObj = tableClass.create(matchObj);
Nils Diewald7c8ced22015-04-15 19:21:00 +0000453
454 var table1, table2;
455
Nils Diewald7c8ced22015-04-15 19:21:00 +0000456 it('should fail to load a table async', function (done) {
Akron7f9a6a32018-07-18 15:05:23 +0200457 expect(tableObj).toBeTruthy();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000458
Akron7f9a6a32018-07-18 15:05:23 +0200459 tableObj.getData([], function (tablen) {
Akron671fdb92017-09-12 18:09:46 +0200460 table1 = tablen;
461 done();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000462 });
463 });
464
Akron671fdb92017-09-12 18:09:46 +0200465
Akronaeeb8252018-09-19 18:51:00 +0200466 xit('should\'nt be parsable (async)', function () {
Nils Diewald7c8ced22015-04-15 19:21:00 +0000467 expect(table1).not.toBeTruthy();
468 });
469
Nils Diewald7c8ced22015-04-15 19:21:00 +0000470
Nils Diewald7c8ced22015-04-15 19:21:00 +0000471 it('should be retrieved async', function (done) {
Akron7f9a6a32018-07-18 15:05:23 +0200472 expect(tableObj).toBeTruthy();
473 tableObj.getData(undefined, function (x) {
Akron671fdb92017-09-12 18:09:46 +0200474 table = x;
475 done();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000476 });
477 });
Nils Diewalda297f062015-04-02 00:23:46 +0000478
Akron7f9a6a32018-07-18 15:05:23 +0200479 it('should parse into a table (async)', function () {
480 expect(table).toBeTruthy();
Akron5b1a6af2018-02-05 15:41:16 +0100481
Akron7f9a6a32018-07-18 15:05:23 +0200482 expect(table.length()).toBe(3);
483
484 expect(table.getToken(0)).toBe("meist");
485 expect(table.getToken(1)).toBe("deutlich");
486 expect(table.getToken(2)).toBe("leistungsfähiger");
487
488 expect(table.getValue(0, "cnx", "p")[0]).toBe("ADV");
489 expect(table.getValue(0, "cnx", "syn")[0]).toBe("@PREMOD");
490 expect(table.getValue(0, "mate", "l")[0]).toBe("meist");
491 expect(table.getValue(0, "mate", "l")[1]).toBeUndefined();
492
493 expect(table.getValue(2, "cnx", "l")[0]).toBe("fähig");
494 expect(table.getValue(2, "cnx", "l")[1]).toBe("leistung");
495 });
496
497 it('should be rendered async', function () {
Akron5b1a6af2018-02-05 15:41:16 +0100498 var e = table.element().firstChild;
Nils Diewald7c8ced22015-04-15 19:21:00 +0000499 expect(e.nodeName).toBe('TABLE');
500 expect(e.children[0].nodeName).toBe('THEAD');
501 var tr = e.children[0].children[0];
502 expect(tr.nodeName).toBe('TR');
503 expect(tr.children[0].nodeName).toBe('TH');
Nils Diewald58141332015-04-07 16:18:45 +0000504
Nils Diewald7c8ced22015-04-15 19:21:00 +0000505 expect(tr.children[0].firstChild.nodeValue).toBe('Foundry');
506 expect(tr.children[1].firstChild.nodeValue).toBe('Layer');
507 expect(tr.children[2].firstChild.nodeValue).toBe('meist');
Akronad1e46a2018-09-19 15:55:40 +0200508 expect(tr.children[2].classList.contains('mark')).toBeFalsy();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000509 expect(tr.children[3].firstChild.nodeValue).toBe('deutlich');
Akronad1e46a2018-09-19 15:55:40 +0200510 expect(tr.children[3].classList.contains('mark')).toBeTruthy();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000511 expect(tr.children[4].firstChild.nodeValue).toBe('leistungsfähiger');
Akronad1e46a2018-09-19 15:55:40 +0200512 expect(tr.children[4].classList.contains('mark')).toBeFalsy();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000513
514 // first row
515 tr = e.children[1].children[0];
516 expect(tr.nodeName).toBe('TR');
517 expect(tr.getAttribute('tabindex')).toEqual('0');
518 expect(tr.children[0].nodeName).toBe('TH');
519 expect(tr.children[0].firstChild.nodeValue).toEqual('cnx');
520 expect(tr.children[1].firstChild.nodeValue).toEqual('l');
521 expect(tr.children[2].firstChild.nodeValue).toEqual('meist');
522 expect(tr.children[3].firstChild.nodeValue).toEqual('deutlich');
Akron47774c42017-07-03 20:14:55 +0200523 expect(tr.children[4].firstChild.firstChild.nodeValue).toEqual('fähig');
524 expect(tr.children[4].lastChild.firstChild.nodeValue).toEqual('leistung');
Nils Diewald7c8ced22015-04-15 19:21:00 +0000525
526 // second row
527 tr = e.children[1].children[1];
528 expect(tr.nodeName).toBe('TR');
529 expect(tr.getAttribute('tabindex')).toEqual('0');
530 expect(tr.children[0].nodeName).toBe('TH');
531 expect(tr.children[0].firstChild.nodeValue).toEqual('cnx');
532 expect(tr.children[1].firstChild.nodeValue).toEqual('p');
533 expect(tr.children[2].firstChild.nodeValue).toEqual('ADV');
534 expect(tr.children[3].firstChild.nodeValue).toEqual('A');
Akron47774c42017-07-03 20:14:55 +0200535 expect(tr.children[4].firstChild.firstChild.nodeValue).toEqual('A');
536 expect(tr.children[4].lastChild.firstChild.nodeValue).toEqual('ADJA');
Akronf2279c42017-12-21 13:48:46 +0100537
538 expect(tr.children[4].firstChild.getAttribute("title")).toEqual('Adjective');
539 expect(tr.children[2].getAttribute("title")).toEqual('Adverb');
540
Nils Diewald58141332015-04-07 16:18:45 +0000541 });
Akron7f9a6a32018-07-18 15:05:23 +0200542
543
544 it('should parse into a table view (sync)', function () {
545 var matchElement = matchElementFactory();
546 expect(matchElement.tagName).toEqual('LI');
547
548 // Match
549 expect(matchElement.children[0].tagName).toEqual('DIV');
550
551 // snippet
552 expect(matchElement.children[0].children[0].tagName).toEqual('DIV');
553 expect(matchElement.children[0].children[0].classList.contains('snippet')).toBeTruthy();
554 expect(matchElement.children[0].children[0].firstChild.nodeValue).toEqual('check');
555
556 // reference
557 expect(matchElement.children[1].classList.contains('ref')).toBeTruthy();
558 expect(matchElement.children[1].firstChild.nodeValue).toEqual('me');
559
560 // not yet
561 expect(matchElement.children[0].children[1]).toBe(undefined);
562
563 /*
564 var info = matchClass.create(matchElement).info();
565 info.showTable();
566 */
567 var matchObj = matchClass.create(matchElement);
568 matchObj.open();
569
570 // Match
571 expect(matchElement.children[0].tagName).toEqual('DIV');
572
573 // snippet
574 expect(matchElement.children[0].children[0].tagName).toEqual('DIV');
575
576 expect(matchElement.children[0].children[0].classList.contains('snippet')).toBeTruthy();
577
578 expect(matchElement.children[0].children[0].firstChild.nodeValue).toEqual('check');
579
580 // reference
581
582 expect(matchElement.children[2].classList.contains('ref')).toBeTruthy();
583 expect(matchElement.children[2].childNodes[1].nodeValue).toEqual('me');
584
585 // Add table
586 matchObj.panel.addTable();
587
588 // now
589 var infotable = matchElement.children[1];
590 expect(infotable.tagName).toEqual('DIV');
591
592 expect(infotable.classList.contains('matchinfo')).toBeTruthy();
593
594 expect(infotable.firstChild.firstChild.firstChild.classList.contains('matchtable')).toBeTruthy();
595
596 // expect(infotable.children[1].classList.contains('addtree')).toBeTruthy();
597 });
598
Nils Diewald58141332015-04-07 16:18:45 +0000599 });
Nils Diewalda297f062015-04-02 00:23:46 +0000600
Akron7f9a6a32018-07-18 15:05:23 +0200601 describe('KorAP.RelationsView', function () {
Akrond8692de2018-07-26 13:06:01 +0200602 beforeAll(beforeAllFunc);
603 afterAll(afterAllFunc);
604
Nils Diewald7c8ced22015-04-15 19:21:00 +0000605 var tree;
Nils Diewalda297f062015-04-02 00:23:46 +0000606
Nils Diewald7c8ced22015-04-15 19:21:00 +0000607 it('should be rendered async 1', function (done) {
Akron7f9a6a32018-07-18 15:05:23 +0200608 var matchObj = matchClass.create(match);
609 var relObj = relClass.create(matchObj);
610 expect(relObj).toBeTruthy();
611 relObj.getData(undefined, undefined, "spans", function (y) {
Akron671fdb92017-09-12 18:09:46 +0200612 tree = y;
613 done();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000614 });
615 });
Nils Diewalda297f062015-04-02 00:23:46 +0000616
Nils Diewald7c8ced22015-04-15 19:21:00 +0000617 it('should be rendered async 2', function () {
Akron7f9a6a32018-07-18 15:05:23 +0200618 expect(tree).toBeTruthy();
619 expect(tree.nodes()).toEqual(49);
620
Nils Diewald7c8ced22015-04-15 19:21:00 +0000621 var e = tree.element();
622 expect(e.nodeName).toEqual('svg');
623 expect(e.getElementsByTagName('g').length).toEqual(48);
Nils Diewald58141332015-04-07 16:18:45 +0000624 });
Akron7f9a6a32018-07-18 15:05:23 +0200625
626
627 it('should add a tree view async 2', function () {
628 var matchElement = matchElementFactory();
629 var matchObj = matchClass.create(matchElement);
630 matchObj.open();
631 matchObj.panel.addTree('mate', 'beebop', 'spans', function () {
632 done();
633 });
634
635 // With added tree
636 var tree = matchElement.children[1].firstChild.firstChild.firstChild;
637 expect(tree.tagName).toEqual('DIV');
638 expect(tree.classList.contains('matchtree')).toBeTruthy();
639 expect(tree.children[0].tagName).toEqual('H6');
640 expect(tree.children[0].children[0].tagName).toEqual('SPAN');
641 expect(tree.children[0].children[0].firstChild.nodeValue).toEqual('mate');
642 expect(tree.children[0].children[1].tagName).toEqual('SPAN');
643 expect(tree.children[0].children[1].firstChild.nodeValue).toEqual('beebop');
644
645 expect(tree.children[1].tagName).toEqual('DIV');
646 });
647
Akron3bdac532019-03-04 13:24:43 +0100648 it('should make the tree downloadable', function () {
649 var treeClass = matchHierClass.create(treeSnippetHierarchy);
650 var treeElement = treeClass.element();
651 expect(treeElement.tagName).toEqual("svg");
652
653 var base64 = treeClass.toBase64();
654 var str = atob(base64);
655 expect(str).toMatch(new RegExp('<defs><style>path'));
656 expect(str).not.toMatch(new RegExp('&nbsp;'));
657 expect(str).toMatch(new RegExp('&amp;'));
658 });
Nils Diewald58141332015-04-07 16:18:45 +0000659 });
Nils Diewalda297f062015-04-02 00:23:46 +0000660
Nils Diewald7c8ced22015-04-15 19:21:00 +0000661
662 describe('KorAP.MatchTreeItem', function () {
Akrond8692de2018-07-26 13:06:01 +0200663 beforeAll(beforeAllFunc);
664 afterAll(afterAllFunc);
665
Nils Diewald7c8ced22015-04-15 19:21:00 +0000666 it('should be initializable', function () {
667 var mi = matchTreeItemClass.create(['cnx/c', 'cnx', 'c'])
668 expect(mi.element().firstChild.nodeValue).toEqual('cnx/c');
669 expect(mi.lcField()).toEqual(' cnx/c');
670 expect(mi.foundry()).toEqual('cnx');
671 expect(mi.layer()).toEqual('c');
672 });
Nils Diewalda297f062015-04-02 00:23:46 +0000673 });
Nils Diewalda297f062015-04-02 00:23:46 +0000674
675
Akron671fdb92017-09-12 18:09:46 +0200676 describe('KorAP.MatchRelation', function () {
Akrond8692de2018-07-26 13:06:01 +0200677 beforeAll(beforeAllFunc);
678 afterAll(afterAllFunc);
Akron671fdb92017-09-12 18:09:46 +0200679
680 var relExample = "<span class=\"context-left\"></span>" +
681 "<span class=\"match\">" +
682 " <span xml:id=\"token-GOE/AGA/01784-p199\">" +
683 " <span xlink:title=\"malt/d:ADV\" " +
684 " xlink:type=\"simple\" " +
685 " xlink:href=\"#token-GOE/AGA/01784-p199\">dann</span>" +
686 " </span>" +
687 " zog " +
688 " <span xlink:title=\"malt/d:SUBJ\" " +
689 " xlink:type=\"simple\" " +
690 " xlink:href=\"#token-GOE/AGA/01784-p199\">ich</span>" +
691 " <span xml:id=\"token-GOE/AGA/01784-p202\">" +
692 " <span xlink:title=\"malt/d:OBJA\" " +
693 " xlink:type=\"simple\" " +
694 " xlink:href=\"#token-GOE/AGA/01784-p199\">mich</span>" +
695 " </span>" +
696 "</span>" +
697 "<span class=\"context-right\"></span>";
698
699
700 it('should be initializable', function () {
Akrond8692de2018-07-26 13:06:01 +0200701 var tree = matchRelClass.create();
Akron671fdb92017-09-12 18:09:46 +0200702 expect(tree.size()).toBe(0);
703 });
704
705 it('should be parse string data', function () {
Akrond8692de2018-07-26 13:06:01 +0200706 var tree = matchRelClass.create(relExample);
Akron671fdb92017-09-12 18:09:46 +0200707 expect(tree.size()).toBe(4);
708 });
Akron671fdb92017-09-12 18:09:46 +0200709 });
710
711
Nils Diewald7c8ced22015-04-15 19:21:00 +0000712 describe('KorAP.MatchTreeMenu', function () {
Akrond8692de2018-07-26 13:06:01 +0200713 beforeAll(beforeAllFunc);
714 afterAll(afterAllFunc);
Nils Diewald7c8ced22015-04-15 19:21:00 +0000715
716 it('should be initializable', function () {
Akrond8692de2018-07-26 13:06:01 +0200717 var menu = matchTreeMenuClass.create([
Akron671fdb92017-09-12 18:09:46 +0200718 ['cnx/c', 'cnx', 'c'],
719 ['xip/c', 'xip', 'c']
Akrond8692de2018-07-26 13:06:01 +0200720 ], matchTreeItemClass);
Nils Diewald7c8ced22015-04-15 19:21:00 +0000721
Akrond8692de2018-07-26 13:06:01 +0200722 expect(menu.itemClass()).toEqual(matchTreeItemClass);
Nils Diewald7c8ced22015-04-15 19:21:00 +0000723 expect(menu.element().nodeName).toEqual('UL');
Akronaba7a5a2016-08-15 21:58:33 +0200724 expect(menu.element().classList.contains('visible')).toBeFalsy();
Nils Diewald7c8ced22015-04-15 19:21:00 +0000725 expect(menu.limit()).toEqual(6);
726 menu.show();
Akronaba7a5a2016-08-15 21:58:33 +0200727 expect(menu.element().classList.contains('visible')).toBeTruthy();
Akronc1457bf2015-06-11 19:24:00 +0200728 expect(menu.item(0).active()).toBe(false);
Nils Diewald7c8ced22015-04-15 19:21:00 +0000729 });
Nils Diewalda297f062015-04-02 00:23:46 +0000730 });
hebasta999d6c12018-04-23 12:44:59 +0200731
732 //Test display and sorting of meta information
733 describe('KorAP.Meta', function(){
Akrond8692de2018-07-26 13:06:01 +0200734 beforeAll(beforeAllFunc);
735 afterAll(afterAllFunc);
736
737 var met = metaClass.create(match, fields);
hebasta999d6c12018-04-23 12:44:59 +0200738 var mel = met.element();
739
740 // Meta information should be parsed into a list
741 it('should parse in a meta view', function(){
Akronfa32c9d2018-11-20 15:39:18 +0100742 expect(mel.tagName).toEqual('DL');
743 expect(mel.children[0].tagName).toEqual('DIV');
744 expect(mel.children[0].children[0].tagName).toEqual('DT');
745 expect(mel.children[0].children[0].attributes[0].name).toEqual('title');
746 expect(mel.children[0].children[1].tagName).toEqual('DD');
747 expect(mel.children[0].children[1].getAttribute('data-type')).toEqual('type:text')
hebasta999d6c12018-04-23 12:44:59 +0200748
Akronfa32c9d2018-11-20 15:39:18 +0100749 expect(mel.children[0].children[0].firstChild.nodeValue).toEqual('author');
750 expect(mel.children[0].children[1].firstChild.nodeValue).toEqual('Sprachpfleger, u.a.');
751 expect(mel.children[0].children[0].attributes[0].value).toEqual('author');
hebasta999d6c12018-04-23 12:44:59 +0200752 });
753
754
Akronfa32c9d2018-11-20 15:39:18 +0100755 /* The keywords in the meta information list should be formatted to be able
756 to chose each keyword separately in the corpusByMatch assistant. */
757 it('keywords should be formatted', function(){
hebasta999d6c12018-04-23 12:44:59 +0200758
Akronfa32c9d2018-11-20 15:39:18 +0100759 //type:string or type:keyword should b not relevant
760 expect(mel.children[1].children[1].getAttribute('data-type')).toEqual('type:string')
761 expect(mel.children[1].children[1].classList.contains('metakeyvalues')).toBeTruthy;
762 expect(mel.children[1].children[1].children[0].tagName).toEqual('DIV');
763 expect(mel.children[1].children[1].children[0].firstChild.nodeValue).toEqual('corenlp');
764 expect(mel.children[1].children[1].children[1].tagName).toEqual('DIV');
765 expect(mel.children[1].children[1].children[1].firstChild.nodeValue).toEqual('corenlp\/constituency');
766
767 expect(mel.children[2].children[1].classList.contains('metakeyvalues')).toBeTruthy;
768 expect(mel.children[2].children[1].children[0].tagName).toEqual('DIV');
769 expect(mel.children[2].children[1].children[0].firstChild.nodeValue).toEqual('kultur');
770 expect(mel.children[2].children[1].children[1].tagName).toEqual('DIV');
771 expect(mel.children[2].children[1].children[1].firstChild.nodeValue).toEqual('film');
hebasta999d6c12018-04-23 12:44:59 +0200772 });
Akrona0ea3c32018-12-14 18:33:48 +0100773
774 it('attachements should be formatted', function(){
Akrond3bb85b2019-02-08 10:15:13 +0100775 //type:attachement with a link
Akrona0ea3c32018-12-14 18:33:48 +0100776 expect(mel.children[3].children[1].getAttribute('data-type')).toEqual('type:attachement')
777 expect(mel.children[3].children[1].classList.contains('metakeyvalues')).toBeFalsy;
778 expect(mel.children[3].children[0].firstChild.nodeValue).toEqual('xlink');
779 expect(mel.children[3].children[1].firstChild.textContent).toEqual('Cool');
780 expect(mel.children[3].children[1].firstChild.tagName).toEqual('A');
781 expect(mel.children[3].children[1].firstChild.getAttribute('href')).toEqual('https://de.wikipedia.org/wiki/Beispiel');
Akrond3bb85b2019-02-08 10:15:13 +0100782
783 //type:attachement with plain text
784 expect(mel.children[4].children[1].getAttribute('data-type')).toEqual('type:attachement')
785 expect(mel.children[4].children[1].classList.contains('metakeyvalues')).toBeFalsy;
786 expect(mel.children[4].children[0].firstChild.nodeValue).toEqual('z-reference');
787 expect(mel.children[4].children[1].firstChild.nodeValue).toEqual('This is a reference');
788 });
Akrona0ea3c32018-12-14 18:33:48 +0100789
790
hebasta999d6c12018-04-23 12:44:59 +0200791
Akronfa32c9d2018-11-20 15:39:18 +0100792 // Meta information should be sorted alphabetically
793 it('should be alphabetically sorted', function(){
794 var a = mel.children[0].children[0].firstChild.nodeValue;
795 var b = mel.children[1].children[0].firstChild.nodeValue;
796 var c = mel.children[2].children[0].firstChild.nodeValue;
797 expect(a.localeCompare(b)).toBe(-1);
798 expect(b.localeCompare(c)).toBe(-1);
Akrona0ea3c32018-12-14 18:33:48 +0100799 });
800
801
802 it('should handle attachements', function () {
803 let uri = attachementClass.create("data:text/plain;title=new,Hallo");
804 expect(uri.contentType).toEqual("text/plain");
805
806 expect(uri.payload).toEqual("Hallo");
807 expect(uri.base64).toBeFalsy();
808 expect(uri.isLink).toBeFalsy();
809 expect(uri.param["title"]).toEqual("new");
810
811 uri = attachementClass.create("data:application/x.korap-link,https://de.wikipedia.org/wiki/Beispiel");
812 expect(uri.contentType).toEqual("application/x.korap-link");
813 expect(uri.payload).toEqual("https://de.wikipedia.org/wiki/Beispiel");
814 expect(uri.base64).toBeFalsy();
815 expect(uri.isLink).toBeTruthy();
816 expect(uri.inline().textContent).toEqual("https://de.wikipedia.org/wiki/Beispiel");
817 expect(uri.inline().nodeType).toEqual(1);
818 expect(uri.inline().tagName).toEqual("A");
819 expect(uri.inline().getAttribute("rel")).toEqual("noopener noreferrer");
820
821
822 uri = attachementClass.create("data:application/x.korap-link;title=Das ist ein Titel,https://de.wikipedia.org/wiki/Beispiel");
823 expect(uri.contentType).toEqual("application/x.korap-link");
824 expect(uri.payload).toEqual("https://de.wikipedia.org/wiki/Beispiel");
825 expect(uri.base64).toBeFalsy();
826 expect(uri.isLink).toBeTruthy();
827 expect(uri.inline().textContent).toEqual("Das ist ein Titel");
828 expect(uri.inline().nodeType).toEqual(1);
829 expect(uri.inline().tagName).toEqual("A");
830 expect(uri.inline().getAttribute("rel")).toEqual("noopener noreferrer");
831
832
833 uri = attachementClass.create("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D");
834 expect(uri.contentType).toEqual("text/plain");
835 expect(uri.payload).toEqual("Hello, World!");
836 expect(uri.base64).toBeTruthy();
837 expect(uri.isLink).toBeFalsy();
838 expect(uri.inline().nodeType).toEqual(3);
839 expect(uri.inline().textContent).toEqual("Hello, World!");
840
841 uri = attachementClass.create("data:text/plain;title= new ; subTitle = old ;base64,SGVsbG8sIFdvcmxkIQ%3D%3D");
842 expect(uri.contentType).toEqual("text/plain");
843 expect(uri.payload).toEqual("Hello, World!");
844 expect(uri.param["title"]).toEqual("new");
845 expect(uri.param["subTitle"]).toEqual("old");
846 expect(uri.base64).toBeTruthy();
847 expect(uri.isLink).toBeFalsy();
848 expect(uri.inline().nodeType).toEqual(3);
849 expect(uri.inline().textContent).toEqual("Hello, World!");
850 });
hebasta999d6c12018-04-23 12:44:59 +0200851 });
Nils Diewald7c8ced22015-04-15 19:21:00 +0000852 // table = view.toTable();
853 // table.sortBy('');
854 // table.element();
855 // tree = view.toTree();
856 // tree.element();
Nils Diewalda297f062015-04-02 00:23:46 +0000857});