blob: c7f53bd1535117dc54940196cac75eea885d6a93 [file] [log] [blame]
Nils Diewald19ccee92014-12-08 11:30:08 +00001function emitKeyboardEvent (element, type, keyCode) {
2 // event type : keydown, keyup, keypress
3 // http://stackoverflow.com/questions/596481/simulate-javascript-key-events
4 // http://stackoverflow.com/questions/961532/firing-a-keyboard-event-in-javascript
5 var keyboardEvent = document.createEvent("KeyboardEvent");
6 var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ?
7 "initKeyboardEvent" : "initKeyEvent";
Nils Diewald19ccee92014-12-08 11:30:08 +00008 keyboardEvent[initMethod](
9 type,
10 true, // bubbles
11 true, // cancelable
12 window, // viewArg: should be window
13 false, // ctrlKeyArg
14 false, // altKeyArg
15 false, // shiftKeyArg
16 false, // metaKeyArg
17 keyCode, // keyCodeArg : unsigned long the virtual key code, else 0
18 0 // charCodeArgs : unsigned long the Unicode character
19 // associated with the depressed key, else 0
20 );
Nils Diewald19ccee92014-12-08 11:30:08 +000021 element.dispatchEvent(keyboardEvent);
22};
23
24
Nils Diewald7c8ced22015-04-15 19:21:00 +000025define(['hint'], function () {
Nils Diewald5c5a7472015-04-02 22:13:38 +000026
Nils Diewald7c8ced22015-04-15 19:21:00 +000027 var hintClass = require("hint");
28 var inputClass = require("hint/input");
29 var contextClass = require("hint/contextanalyzer");
30 var menuClass = require("hint/menu");
31 var menuItemClass = require("hint/item");
Nils Diewald5c5a7472015-04-02 22:13:38 +000032
Nils Diewald7c8ced22015-04-15 19:21:00 +000033 describe('KorAP.InputField', function () {
34 var input;
Nils Diewald1c546922015-04-13 01:56:19 +000035
Nils Diewald7c8ced22015-04-15 19:21:00 +000036 beforeEach(function () {
37 input = document.createElement("input");
38 input.setAttribute('type', "text");
39 input.setAttribute("value", "abcdefghijklmno");
40 input.style.position = 'absolute';
41 document.getElementsByTagName('body')[0].appendChild(input);
42 input.style.top = "20px";
43 input.style.left = "30px";
44 input.focus();
45 input.selectionStart = 5;
Nils Diewald5c5a7472015-04-02 22:13:38 +000046 });
47
Nils Diewald7c8ced22015-04-15 19:21:00 +000048 afterEach(function () {
49 document.getElementsByTagName("body")[0].removeChild(
50 input
51 );
52 });
Nils Diewald5c5a7472015-04-02 22:13:38 +000053
Nils Diewald7c8ced22015-04-15 19:21:00 +000054 afterAll(function () {
55 try {
56 document.getElementsByTagName("body")[0].removeChild(
57 document.getElementById("searchMirror")
58 );
59 }
60 catch (e) {};
61 });
Nils Diewald19ccee92014-12-08 11:30:08 +000062
Nils Diewald7c8ced22015-04-15 19:21:00 +000063 it('should be initializable', function () {
64 // Supports: context, searchField
65 var inputField = inputClass.create(input);
66 expect(inputField._element).not.toBe(undefined);
67 });
Nils Diewald19ccee92014-12-08 11:30:08 +000068
Nils Diewald7c8ced22015-04-15 19:21:00 +000069 it('should have text', function () {
70 expect(input.value).toEqual('abcdefghijklmno');
71 var inputField = inputClass.create(input);
Nils Diewald19ccee92014-12-08 11:30:08 +000072
Nils Diewald7c8ced22015-04-15 19:21:00 +000073 expect(inputField.value()).toEqual("abcdefghijklmno");
Nils Diewald19ccee92014-12-08 11:30:08 +000074
Nils Diewald7c8ced22015-04-15 19:21:00 +000075 expect(input.selectionStart).toEqual(5);
76 expect(inputField.element().selectionStart).toEqual(5);
Nils Diewald7148c6f2015-05-04 15:07:53 +000077 expect(inputField._split()[0]).toEqual("abcde");
78 expect(inputField._split()[1]).toEqual("fghijklmno");
Nils Diewald19ccee92014-12-08 11:30:08 +000079
Nils Diewald7c8ced22015-04-15 19:21:00 +000080 inputField.insert("xyz");
81 expect(inputField.value()).toEqual('abcdexyzfghijklmno');
Nils Diewald7148c6f2015-05-04 15:07:53 +000082 expect(inputField._split()[0]).toEqual("abcdexyz");
83 expect(inputField._split()[1]).toEqual("fghijklmno");
Nils Diewald7c8ced22015-04-15 19:21:00 +000084 });
Nils Diewald19ccee92014-12-08 11:30:08 +000085
Nils Diewald7c8ced22015-04-15 19:21:00 +000086 it('should be correctly positioned', function () {
87 expect(input.value).toEqual('abcdefghijklmno');
88 var inputField = inputClass.create(input);
89 document.getElementsByTagName("body")[0].appendChild(input);
90 inputField.reposition();
91 expect(input.style.left).toEqual("30px");
92 expect(inputField.mirror().style.left.match(/^(\d+)px$/)[1]).toBeGreaterThan(29);
93 expect(inputField.mirror().style.top.match(/^(\d+)px$/)[1]).toBeGreaterThan(20);
94 });
Nils Diewald19ccee92014-12-08 11:30:08 +000095
Nils Diewald7c8ced22015-04-15 19:21:00 +000096 it('should have a correct context', function () {
97 expect(input.value).toEqual('abcdefghijklmno');
98 var inputField = inputClass.create(input);
99 expect(inputField.value()).toEqual("abcdefghijklmno");
100 expect(inputField.element().selectionStart).toEqual(5);
Nils Diewald7148c6f2015-05-04 15:07:53 +0000101 expect(inputField._split()[0]).toEqual("abcde");
Nils Diewald7c8ced22015-04-15 19:21:00 +0000102 expect(inputField.context()).toEqual("abcde");
103 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000104
Nils Diewald7c8ced22015-04-15 19:21:00 +0000105 /*
106 it('should be correctly triggerable', function () {
107 // https://developer.mozilla.org/samples/domref/dispatchEvent.html
108 var hint = KorAP.Hint.create({ "inputField" : input });
109 emitKeyboardEvent(hint.inputField.element, "keypress", 20);
110 });
111 */
Nils Diewald19ccee92014-12-08 11:30:08 +0000112 });
113
Nils Diewald1c546922015-04-13 01:56:19 +0000114
Nils Diewald7c8ced22015-04-15 19:21:00 +0000115 describe('KorAP.ContextAnalyzer', function () {
116 it('should be initializable', function () {
117 var analyzer = contextClass.create(")");
118 expect(analyzer).toBe(undefined);
119 analyzer = contextClass.create(".+?");
120 expect(analyzer).not.toBe(undefined);
121 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000122
Nils Diewald7c8ced22015-04-15 19:21:00 +0000123 it('should check correctly', function () {
124 analyzer = contextClass.create(KorAP.context);
125 expect(analyzer.test("cnx/]cnx/c=")).toEqual("cnx/c=");
126 expect(analyzer.test("cnx/c=")).toEqual("cnx/c=");
127 expect(analyzer.test("cnx/c=np mate/m=mood:")).toEqual("mate/m=mood:");
128 expect(analyzer.test("impcnx/")).toEqual("impcnx/");
129 expect(analyzer.test("cnx/c=npcnx/")).toEqual("npcnx/");
130 expect(analyzer.test("mate/m=degree:pos corenlp/ne_dewac_175m_600="))
131 .toEqual("corenlp/ne_dewac_175m_600=");
Akron113cc1a2016-01-22 21:17:57 +0100132 expect(analyzer.test("corenlp/")).toEqual("corenlp/");
133 expect(analyzer.test("corenlp/c=")).toEqual("corenlp/c=");
134 expect(analyzer.test("corenlp/c=PP-")).toEqual("corenlp/c=PP-");
135 expect(analyzer.test("corenlp/c=XY-")).toEqual("corenlp/c=XY-");
Nils Diewald7c8ced22015-04-15 19:21:00 +0000136 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000137 });
138
Nils Diewald19ccee92014-12-08 11:30:08 +0000139
Nils Diewald7c8ced22015-04-15 19:21:00 +0000140 describe('KorAP.Hint', function () {
141 KorAP.hintArray = {
142 "corenlp/" : [
143 ["Named Entity", "ne=" , "Combined"],
144 ["Named Entity", "ne_dewac_175m_600=" , "ne_dewac_175m_600"],
145 ["Named Entity", "ne_hgc_175m_600=", "ne_hgc_175m_600"]
146 ]
147 };
Nils Diewald19ccee92014-12-08 11:30:08 +0000148
Nils Diewald7c8ced22015-04-15 19:21:00 +0000149 beforeEach(function () {
150 input = document.createElement("input");
151 input.setAttribute("type", "text");
152 input.setAttribute("value", "abcdefghijklmno");
153 input.style.position = 'absolute';
154 input.style.top = "20px";
155 input.style.left = "30px";
156 input.focus();
157 input.selectionStart = 5;
158 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000159
Nils Diewald7c8ced22015-04-15 19:21:00 +0000160 it('should be initializable', function () {
161 // Supports: context, searchField
162 var hint = hintClass.create({
163 inputField : input
164 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000165
Nils Diewald7c8ced22015-04-15 19:21:00 +0000166 expect(hint).toBeTruthy();
167 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000168 });
169
Nils Diewald7c8ced22015-04-15 19:21:00 +0000170 describe('KorAP.HintMenuItem', function () {
171 it('should be initializable', function () {
172 expect(
173 function() { menuItemClass.create([]) }
174 ).toThrow(new Error("Missing parameters"));
Nils Diewald19ccee92014-12-08 11:30:08 +0000175
Nils Diewald7c8ced22015-04-15 19:21:00 +0000176 expect(
177 function() { menuItemClass.create(['CoreNLP']) }
178 ).toThrow(new Error("Missing parameters"));
Nils Diewald19ccee92014-12-08 11:30:08 +0000179
Nils Diewald7c8ced22015-04-15 19:21:00 +0000180 var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
181 expect(menuItem.name()).toEqual('CoreNLP');
182 expect(menuItem.action()).toEqual('corenlp/');
183 expect(menuItem.desc()).toBeUndefined();
Nils Diewald19ccee92014-12-08 11:30:08 +0000184
Nils Diewald7c8ced22015-04-15 19:21:00 +0000185 menuItem = menuItemClass.create(
186 ['CoreNLP', 'corenlp/', 'It\'s funny']
187 );
188 expect(menuItem.name()).toEqual('CoreNLP');
189 expect(menuItem.action()).toEqual('corenlp/');
190 expect(menuItem.desc()).not.toBeUndefined();
191 expect(menuItem.desc()).toEqual('It\'s funny');
192 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000193
Nils Diewald7c8ced22015-04-15 19:21:00 +0000194 it('should have an element', function () {
195 var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
196 expect(menuItem.element()).not.toBe(undefined);
197 expect(menuItem.element().nodeName).toEqual("LI");
Nils Diewald19ccee92014-12-08 11:30:08 +0000198
Nils Diewald7c8ced22015-04-15 19:21:00 +0000199 var title = menuItem.element().firstChild;
200 expect(title.nodeName).toEqual("SPAN");
201 expect(title.firstChild.nodeType).toEqual(3);
202 expect(title.firstChild.nodeValue).toEqual("CoreNLP");
203 expect(menuItem.element().childNodes[0]).not.toBe(undefined);
204 expect(menuItem.element().childNodes[1]).toBe(undefined);
Nils Diewald19ccee92014-12-08 11:30:08 +0000205
Nils Diewald7c8ced22015-04-15 19:21:00 +0000206 menuItem = menuItemClass.create(
207 ['CoreNLP', 'corenlp/', 'my DescRiption']
208 );
209 expect(menuItem.element()).not.toBe(undefined);
210 expect(menuItem.element().nodeName).toEqual("LI");
Nils Diewald19ccee92014-12-08 11:30:08 +0000211
Nils Diewald7c8ced22015-04-15 19:21:00 +0000212 title = menuItem.element().firstChild;
213 expect(title.nodeName).toEqual("SPAN");
214 expect(title.firstChild.nodeType).toEqual(3); // TextNode
215 expect(title.firstChild.nodeValue).toEqual("CoreNLP");
Nils Diewald19ccee92014-12-08 11:30:08 +0000216
Nils Diewald7c8ced22015-04-15 19:21:00 +0000217 expect(menuItem.element().childNodes[0]).not.toBe(undefined);
218 expect(menuItem.element().childNodes[1]).not.toBe(undefined);
Nils Diewald19ccee92014-12-08 11:30:08 +0000219
Nils Diewald7c8ced22015-04-15 19:21:00 +0000220 var desc = menuItem.element().lastChild;
221 expect(desc.nodeName).toEqual("SPAN");
222 expect(desc.firstChild.nodeType).toEqual(3); // TextNode
223 expect(desc.firstChild.nodeValue).toEqual("my DescRiption");
224 });
Nils Diewald1c546922015-04-13 01:56:19 +0000225
Nils Diewald19ccee92014-12-08 11:30:08 +0000226
Nils Diewald7c8ced22015-04-15 19:21:00 +0000227 it('should be activatable and deactivateable by class', function () {
228 var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
229 expect(menuItem.active()).toBe(false);
230 expect(menuItem.element().getAttribute("class")).toBe(null);
231 menuItem.active(true);
232 expect(menuItem.active()).toBe(true);
233 expect(menuItem.element().getAttribute("class")).toEqual("active");
234 menuItem.active(false); // Is active
235 expect(menuItem.active()).toBe(false);
236 expect(menuItem.element().getAttribute("class")).toEqual("");
237 menuItem.active(true);
238 expect(menuItem.active()).toBe(true);
239 expect(menuItem.element().getAttribute("class")).toEqual("active");
Nils Diewald19ccee92014-12-08 11:30:08 +0000240
Nils Diewald7c8ced22015-04-15 19:21:00 +0000241 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
242 expect(menuItem.active()).toBe(false);
243 expect(menuItem.element().getAttribute("class")).toBe(null);
244 menuItem.active(false); // Is not active
245 expect(menuItem.active()).toBe(false);
246 expect(menuItem.element().getAttribute("class")).toBe(null);
247 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000248
Nils Diewald7c8ced22015-04-15 19:21:00 +0000249 it('should be set to boundary', function () {
250 var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
251 expect(menuItem.active()).toBe(false);
252 expect(menuItem.element().getAttribute("class")).toBe(null);
Nils Diewald19ccee92014-12-08 11:30:08 +0000253
Nils Diewald7c8ced22015-04-15 19:21:00 +0000254 // Set active
255 menuItem.active(true);
256 expect(menuItem.active()).toBe(true);
257 expect(menuItem.noMore()).toBe(false);
258 expect(menuItem.element().getAttribute("class")).toEqual("active");
Nils Diewald19ccee92014-12-08 11:30:08 +0000259
Nils Diewald7c8ced22015-04-15 19:21:00 +0000260 // Set no more
261 menuItem.noMore(true);
262 expect(menuItem.active()).toBe(true);
263 expect(menuItem.noMore()).toBe(true);
264 expect(menuItem.element().getAttribute("class")).toEqual("active no-more");
Nils Diewald1c546922015-04-13 01:56:19 +0000265
Nils Diewald7c8ced22015-04-15 19:21:00 +0000266 // No no more
267 menuItem.noMore(false);
268 expect(menuItem.active()).toBe(true);
269 expect(menuItem.noMore()).toBe(false);
270 expect(menuItem.element().getAttribute("class")).toEqual("active");
Nils Diewald1c546922015-04-13 01:56:19 +0000271
Nils Diewald7c8ced22015-04-15 19:21:00 +0000272 // Set no more, deactivate
273 menuItem.noMore(true);
274 menuItem.active(false);
275 expect(menuItem.active()).toBe(false);
276 expect(menuItem.noMore()).toBe(true);
277 expect(menuItem.element().getAttribute("class")).toEqual("no-more");
Nils Diewald19ccee92014-12-08 11:30:08 +0000278
Nils Diewald7c8ced22015-04-15 19:21:00 +0000279 // Set active
280 menuItem.active(true);
281 expect(menuItem.active()).toBe(true);
282 expect(menuItem.noMore()).toBe(true);
283 expect(menuItem.element().getAttribute("class")).toEqual("no-more active");
284 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000285
Nils Diewald7c8ced22015-04-15 19:21:00 +0000286 it('should be highlightable', function () {
287 // Highlight in the middle
288 var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
289 menuItem.highlight("ren");
290 expect(menuItem.element().innerHTML).toEqual("<span>Co<mark>reN</mark>LP</span>");
Nils Diewald19ccee92014-12-08 11:30:08 +0000291
Nils Diewald7c8ced22015-04-15 19:21:00 +0000292 menuItem.lowlight();
293 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>");
Nils Diewald19ccee92014-12-08 11:30:08 +0000294
Nils Diewald7c8ced22015-04-15 19:21:00 +0000295 // Starting highlight
296 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
297 menuItem.highlight("cor");
298 expect(menuItem.element().innerHTML).toEqual("<span><mark>Cor</mark>eNLP</span>");
Nils Diewald19ccee92014-12-08 11:30:08 +0000299
Nils Diewald7c8ced22015-04-15 19:21:00 +0000300 menuItem.lowlight();
301 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>");
302
303 // Starting highlight - short
304 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
305 menuItem.highlight("c");
306 expect(menuItem.element().innerHTML).toEqual("<span><mark>C</mark>oreNLP</span>");
307
308 menuItem.lowlight();
309 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>");
310
311 // Highlight at the end
312 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
313 menuItem.highlight("nlp");
314 expect(menuItem.element().innerHTML).toEqual("<span>Core<mark>NLP</mark></span>");
315
316 menuItem.lowlight();
317 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>");
318
319 // Highlight at the end - short
320 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
321 menuItem.highlight("p");
322 expect(menuItem.element().innerHTML).toEqual("<span>CoreNL<mark>P</mark></span>");
323
324 menuItem.lowlight();
325 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>");
326
327 // No highlight
328 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']);
329 menuItem.highlight("xp");
330 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>");
331
332 menuItem.lowlight();
333 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>");
334
335 // Highlight in the middle - first
336 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']);
337
338 menuItem.highlight("ren");
339 expect(menuItem.element().innerHTML).toEqual("<span>Co<mark>reN</mark>LP</span><span class=\"desc\">This is my Example</span>");
340
341 menuItem.lowlight();
342 expect(menuItem.element().innerHTML).toEqual('<span>CoreNLP</span><span class="desc">This is my Example</span>');
343
344 // Highlight in the middle - second
345 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']);
346 menuItem.highlight("ampl");
347 expect(menuItem.element().innerHTML).toEqual('<span>CoreNLP</span><span class="desc">This is my Ex<mark>ampl</mark>e</span>');
348
349 menuItem.lowlight();
350 expect(menuItem.element().innerHTML).toEqual('<span>CoreNLP</span><span class="desc">This is my Example</span>');
351
352 // Highlight in the middle - both
353 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']);
354
355 menuItem.highlight("e");
356 expect(menuItem.element().innerHTML).toEqual('<span>Cor<mark>e</mark>NLP</span><span class="desc">This is my <mark>E</mark>xampl<mark>e</mark></span>');
357
358 menuItem.lowlight();
359 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\">This is my Example</span>");
360
361 // Highlight in the end - second
362 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']);
363 menuItem.highlight("le");
364 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\">This is my Examp<mark>le</mark></span>");
365
366 menuItem.lowlight();
367 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\">This is my Example</span>");
368
369 // Highlight at the beginning - second
370 menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']);
371 menuItem.highlight("this");
372 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\"><mark>This</mark> is my Example</span>");
373
374 menuItem.lowlight();
375 expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\">This is my Example</span>");
376 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000377 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000378
Nils Diewald7c8ced22015-04-15 19:21:00 +0000379 describe('KorAP.HintMenu', function () {
Nils Diewald19ccee92014-12-08 11:30:08 +0000380
Nils Diewald7c8ced22015-04-15 19:21:00 +0000381 var list = [
382 ["Constituency", "c=", "Example 1"],
383 ["Lemma", "l="],
384 ["Morphology", "m=", "Example 2"],
385 ["Part-of-Speech", "p="],
386 ["Syntax", "syn="]
387 ];
Nils Diewald19ccee92014-12-08 11:30:08 +0000388
Nils Diewald7c8ced22015-04-15 19:21:00 +0000389 it('should be initializable', function () {
Nils Diewald19ccee92014-12-08 11:30:08 +0000390
Nils Diewald7c8ced22015-04-15 19:21:00 +0000391 var menu = menuClass.create(null, "cnx/", list);
Nils Diewald7c8ced22015-04-15 19:21:00 +0000392 expect(menu.element().nodeName).toEqual('UL');
393 expect(menu.element().style.opacity).toEqual("0");
Nils Diewald19ccee92014-12-08 11:30:08 +0000394
Nils Diewald7c8ced22015-04-15 19:21:00 +0000395 menu.limit(8);
Nils Diewald19ccee92014-12-08 11:30:08 +0000396
Nils Diewald7c8ced22015-04-15 19:21:00 +0000397 // view
398 menu.show();
Nils Diewald19ccee92014-12-08 11:30:08 +0000399
Nils Diewald7c8ced22015-04-15 19:21:00 +0000400 // First element in list
401 expect(menu.item(0).active()).toBe(true);
402 expect(menu.item(0).noMore()).toBe(true);
403
404 // Middle element in list
405 expect(menu.item(2).active()).toBe(false);
406 expect(menu.item(2).noMore()).toBe(false);
Nils Diewald19ccee92014-12-08 11:30:08 +0000407
Nils Diewald7c8ced22015-04-15 19:21:00 +0000408 // Last element in list
409 expect(menu.item(menu.length() - 1).active()).toBe(false);
410 expect(menu.item(menu.length() - 1).noMore()).toBe(true);
411 });
Nils Diewald19ccee92014-12-08 11:30:08 +0000412 });
413});