A new function for menu that gets all DIRECT element children by
tagName. Used by menuSpec and so on.
Change-Id: I4fa2d55947815581b1fa8b127b0609ede2188862
diff --git a/dev/js/spec/alwaysMenuSpec.js b/dev/js/spec/alwaysMenuSpec.js
index f849ebd..54458c9 100644
--- a/dev/js/spec/alwaysMenuSpec.js
+++ b/dev/js/spec/alwaysMenuSpec.js
@@ -220,16 +220,16 @@
expect(menu.show()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
- expect(menu.element().getElementsByTagName("li")[1].getAttribute("data-action")).toEqual("l=");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].getAttribute("data-action")).toEqual("l=");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Check boundaries
- expect(menu.element().getElementsByTagName("li")[0].classList.contains("no-more")).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].classList.contains("no-more")).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].classList.contains("no-more")).toBe(false);
+ expect(menu.directElementChildrenByTagName("li")[0].classList.contains("no-more")).toBe(true);
+ expect(menu.directElementChildrenByTagName("li")[1].classList.contains("no-more")).toBe(false);
+ expect(menu.directElementChildrenByTagName("li")[2].classList.contains("no-more")).toBe(false);
});
it('should be filterable', function () {
@@ -239,15 +239,15 @@
expect(menu.alwaysEntryValue("o").alwaysEntryValue()).toEqual("o");
expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("o");
expect(menu.alwaysEntry().element().innerHTML).toEqual("Speichern");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Check boundaries
- expect(menu.element().getElementsByTagName("li")[0].classList.contains("no-more")).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].classList.contains("no-more")).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].classList.contains("no-more")).toBe(true);
+ expect(menu.directElementChildrenByTagName("li")[0].classList.contains("no-more")).toBe(true);
+ expect(menu.directElementChildrenByTagName("li")[1].classList.contains("no-more")).toBe(false);
+ expect(menu.directElementChildrenByTagName("li")[2].classList.contains("no-more")).toBe(true);
menu.limit(2);
@@ -255,34 +255,34 @@
expect(menu.alwaysEntryValue("o").alwaysEntryValue()).toEqual("o");
expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("o");
expect(menu.alwaysEntry().element().innerHTML).toEqual("Speichern");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
- expect(menu.element().getElementsByTagName("li")[2]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2]).toBe(undefined);
// Check boundaries
- expect(menu.element().getElementsByTagName("li")[0].classList.contains("no-more")).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].classList.contains("no-more")).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].classList.contains("no-more")).toBe(true);
+ expect(menu.directElementChildrenByTagName("li")[1].classList.contains("no-more")).toBe(false);
+ expect(menu.directElementChildrenByTagName("li")[2]).toBe(undefined);
expect(menu.prefix("e").show()).toBe(true);
expect(menu.alwaysEntryValue("e").alwaysEntryValue()).toEqual("e");
expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("e");
expect(menu.alwaysEntry().element().innerHTML).toEqual("Speichern");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
- expect(menu.element().getElementsByTagName("li")[2]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2]).toBe(undefined);
menu.limit(5);
expect(menu.prefix("a").show()).toBe(true);
expect(menu.alwaysEntryValue("a").alwaysEntryValue()).toEqual("a");
expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("a");
expect(menu.alwaysEntry().element().innerHTML).toEqual("Speichern");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Ex<mark>a</mark>mple 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemm<mark>a</mark></strong>");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Ex<mark>a</mark>mple 2</span>");
- expect(menu.element().getElementsByTagName("li")[3].innerHTML).toEqual("<strong>P<mark>a</mark>rt-of-Speech</strong>");
- expect(menu.element().getElementsByTagName("li")[4].innerHTML).toEqual("<strong>Synt<mark>a</mark>x</strong>");
- expect(menu.element().getElementsByTagName("li")[5]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Ex<mark>a</mark>mple 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemm<mark>a</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Ex<mark>a</mark>mple 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[3].innerHTML).toEqual("<strong>P<mark>a</mark>rt-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[4].innerHTML).toEqual("<strong>Synt<mark>a</mark>x</strong>");
+ expect(menu.directElementChildrenByTagName("li")[5]).toBe(undefined);
});
@@ -295,91 +295,91 @@
// Show only 3 items
menu.limit(3);
expect(menu.show()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate next (1)
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate next (2)
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate next (3)
// scroll!
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate next (4)
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate next (5) - Entry / Speichern
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(true);
// Activate next (6) - ROLL
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Active next (7)
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
expect(menu._prefix.active()).toBe(false);
@@ -402,47 +402,47 @@
expect(menu._prefix.active()).toBe(false);
expect(menu.alwaysEntryValue()).toBe("");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate prev (1) - roll to bottom
menu.prev();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(true);
// Activate prev (2)
menu.prev();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate prev (3)
menu.prev();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate prev (4)
@@ -453,7 +453,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Syntax");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate prev (5)
@@ -464,7 +464,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Part-of-Speech");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate prev (6)
@@ -475,7 +475,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Morphology");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate next (7)
@@ -486,7 +486,7 @@
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2).name()).toEqual("Morphology");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
// Activate prev (8)
@@ -500,7 +500,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Morphology");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(true);
// Activate prev (10)
@@ -511,7 +511,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Syntax");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
expect(menu.alwaysEntry().active()).toBe(false);
expect(menu._prefix.active()).toBe(false);
expect(menu.alwaysEntryValue()).toBe("");
@@ -543,40 +543,40 @@
expect(menu.alwaysEntry().active()).toBe(false);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
// Next (1)
menu.next();
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
// Next (2)
menu.next();
expect(menu.shownItem(0).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Part-of-Speech");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
// Next (3) - to prefix
menu.next();
expect(menu.shownItem(0).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Part-of-Speech");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
expect(menu._prefix.active()).toBe(true);
@@ -585,10 +585,10 @@
// Next (4) - to entry
menu.next();
expect(menu.shownItem(0).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Part-of-Speech");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
expect(menu._prefix.active()).toBe(false);
@@ -596,10 +596,10 @@
menu.next();
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -621,20 +621,20 @@
expect(menu.alwaysEntry().active()).toBe(false);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
// Next (1)
menu.next();
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
expect(menu.alwaysEntryValue()).toBe("ex");
@@ -646,11 +646,11 @@
expect(menu.prefix()).toEqual('ex');
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
expect(menu.alwaysEntryValue()).toBe("ex");
@@ -666,10 +666,10 @@
expect(menu._prefix.active()).toBe(false);
expect(menu.alwaysEntry().active()).toBe(false);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -678,10 +678,10 @@
expect(menu._prefix.active()).toBe(false);
expect(menu.prefix()).toEqual('e');
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
expect(menu._prefix.active()).toBe(false);
@@ -691,10 +691,10 @@
menu.next();
expect(menu._prefix.active()).toBe(true);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
expect(menu._prefix.active()).toBe(true);
@@ -704,10 +704,10 @@
menu.next();
expect(menu._prefix.active()).toBe(false);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
expect(menu._prefix.active()).toBe(false);
@@ -717,10 +717,10 @@
menu.next();
expect(menu._prefix.active()).toBe(false);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -739,13 +739,13 @@
expect(menu._prefix.active()).toBe(false);
expect(menu.alwaysEntry().active()).toBe(false);
expect(menu.shownItem(0).name()).toEqual("PPS");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual(
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual(
"<strong>PPS</strong><span>Personal <mark>Pro</mark>noun, <mark>Sin</mark>gular</span>"
);
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("PPSA");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>PPSA</strong><span>Personal <mark>Pro</mark>noun, <mark>Sin</mark>gular, Accusative</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>PPSA</strong><span>Personal <mark>Pro</mark>noun, <mark>Sin</mark>gular, Accusative</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -765,7 +765,7 @@
expect(menu.alwaysEntryValue()).toBe(" p");
expect(menu.show()).toBe(true);
expect(menu.shownItem(0).name()).toEqual("PP");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual(
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual(
"<strong><mark>P</mark><mark>P</mark></strong>"+
"<span><mark>P</mark>ersonal <mark>P</mark>ronoun</span>"
);
@@ -816,13 +816,13 @@
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
expect(menu.shownItem(3)).toBe(undefined);
expect(menu._prefix.active()).toEqual(false);
@@ -836,7 +836,7 @@
expect(menu.prefix()).toEqual("a");
expect(menu.alwaysEntryValue()).toEqual("a");
expect(menu.shownItem(0).name()).toEqual("Autor");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong><mark>A</mark>utor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong><mark>A</mark>utor</strong>");
menu._prefix.add('u');
menu._entry.add('u');
@@ -846,7 +846,7 @@
expect(menu.shownItem(0).name()).toEqual("Autor");
expect(menu._prefix.active()).toEqual(false);
expect(menu._entry.active()).toEqual(false);
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong><mark>Au</mark>tor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong><mark>Au</mark>tor</strong>");
menu._prefix.chop();
menu._entry.chop();
@@ -854,7 +854,7 @@
expect(menu.prefix()).toEqual("a");
expect(menu.alwaysEntryValue()).toEqual("a");
expect(menu.shownItem(0).name()).toEqual("Autor");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong><mark>A</mark>utor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong><mark>A</mark>utor</strong>");
menu._prefix.chop();
menu._entry.chop();
@@ -864,13 +864,13 @@
expect(menu._prefix.active()).toEqual(false);
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
expect(menu.shownItem(3)).toBe(undefined);
@@ -883,13 +883,13 @@
expect(menu._entry.active()).toEqual(false);
expect(menu.alwaysEntryValue()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
// Forward
@@ -899,13 +899,13 @@
expect(menu._prefix.active()).toEqual(false);
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
expect(menu.shownItem(3)).toBe(undefined);
@@ -916,13 +916,13 @@
expect(menu._prefix.active()).toEqual(false);
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(true);
expect(menu.shownItem(3)).toBe(undefined);
@@ -931,13 +931,13 @@
expect(menu.prefix()).toEqual("");
expect(menu.alwaysEntryValue()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Länge");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Länge</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Länge</strong>");
expect(menu.shownItem(2).active()).toBe(true);
expect(menu.shownItem(3)).toBe(undefined);
expect(menu._prefix.active()).toEqual(false);
@@ -948,13 +948,13 @@
expect(menu.prefix()).toEqual("");
expect(menu.alwaysEntryValue()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Länge");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Länge</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Länge</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Autor");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Autor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Autor</strong>");
expect(menu.shownItem(2).active()).toBe(true);
expect(menu.shownItem(3)).toBe(undefined);
expect(menu._prefix.active()).toEqual(false);
@@ -965,13 +965,13 @@
expect(menu.prefix()).toEqual("");
expect(menu.alwaysEntryValue()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Länge");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Länge</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Länge</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Autor");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Autor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Autor</strong>");
expect(menu.shownItem(2).active()).toBe(false);
expect(menu.shownItem(3)).toBe(undefined);
expect(menu._prefix.active()).toEqual(false);
@@ -982,13 +982,13 @@
expect(menu.prefix()).toEqual("");
expect(menu.alwaysEntryValue()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
});
@@ -1013,10 +1013,10 @@
expect(menu.alwaysEntryValue()).toEqual("El");
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1027,10 +1027,10 @@
expect(menu.alwaysEntryValue()).toEqual("El");
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1041,10 +1041,10 @@
expect(menu.alwaysEntryValue()).toEqual("El");
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1055,10 +1055,10 @@
expect(menu.alwaysEntryValue()).toEqual("El");
expect(menu._entry.active()).toEqual(true);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1068,10 +1068,10 @@
expect(menu.alwaysEntryValue()).toEqual("El");
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1082,11 +1082,11 @@
expect(menu.alwaysEntryValue()).toEqual("El");
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
});
@@ -1109,10 +1109,10 @@
expect(menu.alwaysEntryValue()).toEqual("el");
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1122,11 +1122,11 @@
expect(menu._entry.active()).toEqual(true);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1137,11 +1137,11 @@
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1150,10 +1150,10 @@
expect(menu._prefix.active()).toEqual(false);
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
});
@@ -1175,10 +1175,10 @@
expect(menu.alwaysEntry().value()).toEqual("el");
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1187,10 +1187,10 @@
expect(menu._prefix.active()).toEqual(false);
expect(menu._entry.active()).toEqual(true);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1199,10 +1199,10 @@
expect(menu._prefix.active()).toEqual(true);
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1213,10 +1213,10 @@
expect(menu._prefix.active()).toEqual(false);
expect(menu._entry.active()).toEqual(true);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1226,10 +1226,10 @@
expect(menu._prefix.active()).toEqual(false);
expect(menu._entry.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
});
diff --git a/dev/js/spec/menuSpec.js b/dev/js/spec/menuSpec.js
index 664a5b9..5d115a8 100644
--- a/dev/js/spec/menuSpec.js
+++ b/dev/js/spec/menuSpec.js
@@ -419,16 +419,16 @@
expect(menu.show()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
- expect(menu.element().getElementsByTagName("li")[1].getAttribute("data-action")).toEqual("l=");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].getAttribute("data-action")).toEqual("l=");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Check boundaries
- expect(menu.element().getElementsByTagName("li")[0].classList.contains("no-more")).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].classList.contains("no-more")).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].classList.contains("no-more")).toBe(false);
+ expect(menu.directElementChildrenByTagName("li")[0].classList.contains("no-more")).toBe(true);
+ expect(menu.directElementChildrenByTagName("li")[1].classList.contains("no-more")).toBe(false);
+ expect(menu.directElementChildrenByTagName("li")[2].classList.contains("no-more")).toBe(false);
});
it('should be filterable', function () {
@@ -436,44 +436,44 @@
menu.limit(3);
expect(menu.prefix("o").show()).toBe(true);
expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("o");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Check boundaries
- expect(menu.element().getElementsByTagName("li")[0].classList.contains("no-more")).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].classList.contains("no-more")).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].classList.contains("no-more")).toBe(true);
+ expect(menu.directElementChildrenByTagName("li")[0].classList.contains("no-more")).toBe(true);
+ expect(menu.directElementChildrenByTagName("li")[1].classList.contains("no-more")).toBe(false);
+ expect(menu.directElementChildrenByTagName("li")[2].classList.contains("no-more")).toBe(true);
menu.limit(2);
expect(menu.prefix("o").show()).toBe(true);
expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("o");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
- expect(menu.element().getElementsByTagName("li")[2]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2]).toBe(undefined);
// Check boundaries
- expect(menu.element().getElementsByTagName("li")[0].classList.contains("no-more")).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].classList.contains("no-more")).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].classList.contains("no-more")).toBe(true);
+ expect(menu.directElementChildrenByTagName("li")[1].classList.contains("no-more")).toBe(false);
+ expect(menu.directElementChildrenByTagName("li")[2]).toBe(undefined);
expect(menu.prefix("e").show()).toBe(true);
expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("e");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
- expect(menu.element().getElementsByTagName("li")[2]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2]).toBe(undefined);
menu.limit(5);
expect(menu.prefix("a").show()).toBe(true);
expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("a");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Ex<mark>a</mark>mple 1</span>");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemm<mark>a</mark></strong>");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Ex<mark>a</mark>mple 2</span>");
- expect(menu.element().getElementsByTagName("li")[3].innerHTML).toEqual("<strong>P<mark>a</mark>rt-of-Speech</strong>");
- expect(menu.element().getElementsByTagName("li")[4].innerHTML).toEqual("<strong>Synt<mark>a</mark>x</strong>");
- expect(menu.element().getElementsByTagName("li")[5]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Ex<mark>a</mark>mple 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemm<mark>a</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Ex<mark>a</mark>mple 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[3].innerHTML).toEqual("<strong>P<mark>a</mark>rt-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[4].innerHTML).toEqual("<strong>Synt<mark>a</mark>x</strong>");
+ expect(menu.directElementChildrenByTagName("li")[5]).toBe(undefined);
});
it('should be nextable', function () {
@@ -483,74 +483,74 @@
// Show only 3 items
menu.limit(3);
expect(menu.show()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate next (1)
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate next (2)
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate next (3)
// scroll!
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate next (4)
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate next (5) - ROLL
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Active next (6)
menu.next();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
});
it('should be nextable without active field', function () {
@@ -568,33 +568,33 @@
menu.limit(3);
expect(menu.show()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Lemma</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate prev (1) - roll to bottom
menu.prev();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate prev (2)
menu.prev();
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Syntax</strong>");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate prev (3)
menu.prev();
@@ -604,7 +604,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Syntax");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate prev (4)
menu.prev();
@@ -614,7 +614,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Part-of-Speech");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate prev (5)
menu.prev();
@@ -624,7 +624,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Morphology");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate next (1)
menu.next();
@@ -634,7 +634,7 @@
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2).name()).toEqual("Morphology");
expect(menu.shownItem(2).active()).toBe(false);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
// Activate prev (6)
menu.prev();
@@ -647,7 +647,7 @@
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Syntax");
expect(menu.shownItem(2).active()).toBe(true);
- expect(menu.element().getElementsByTagName("li")[3]).toBe(undefined);
+ expect(menu.directElementChildrenByTagName("li")[3]).toBe(undefined);
});
it('should be prevable without active field', function () {
@@ -666,49 +666,49 @@
expect(menu.prefix("o").show()).toBe(true);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
// Next (1)
menu.next();
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
// Next (2)
menu.next();
expect(menu.shownItem(0).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Part-of-Speech");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
// Next (3) - to prefix
menu.next();
expect(menu.shownItem(0).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Part-of-Speech");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
menu.next();
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
});
@@ -722,20 +722,20 @@
expect(menu.prefix("ex").show()).toBe(true);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
// Next (1)
menu.next();
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
@@ -744,11 +744,11 @@
expect(menu.prefix()).toEqual('ex');
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -759,10 +759,10 @@
expect(menu.prefix("e").show()).toBe(true);
expect(menu._prefix.active()).toBe(false);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -771,10 +771,10 @@
expect(menu._prefix.active()).toBe(false);
expect(menu.prefix()).toEqual('e');
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
@@ -782,10 +782,10 @@
menu.next();
expect(menu._prefix.active()).toBe(true);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -793,10 +793,10 @@
menu.next();
expect(menu._prefix.active()).toBe(false);
expect(menu.shownItem(0).name()).toEqual("Constituency");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Morphology");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
});
@@ -808,13 +808,13 @@
menu.limit(2);
expect(menu.prefix("pro sin").show()).toBe(true);
expect(menu.shownItem(0).name()).toEqual("PPS");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual(
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual(
"<strong>PPS</strong><span>Personal <mark>Pro</mark>noun, <mark>Sin</mark>gular</span>"
);
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("PPSA");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>PPSA</strong><span>Personal <mark>Pro</mark>noun, <mark>Sin</mark>gular, Accusative</span>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>PPSA</strong><span>Personal <mark>Pro</mark>noun, <mark>Sin</mark>gular, Accusative</span>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -831,7 +831,7 @@
menu._prefix.add("p")
expect(menu.show()).toBe(true);
expect(menu.shownItem(0).name()).toEqual("PP");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual(
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual(
"<strong><mark>P</mark><mark>P</mark></strong>"+
"<span><mark>P</mark>ersonal <mark>P</mark>ronoun</span>"
);
@@ -888,13 +888,13 @@
expect(menu.prefix()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
expect(menu.shownItem(3)).toBe(undefined);
@@ -902,31 +902,31 @@
expect(menu.show()).toBe(true);
expect(menu.prefix()).toEqual("a");
expect(menu.shownItem(0).name()).toEqual("Autor");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong><mark>A</mark>utor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong><mark>A</mark>utor</strong>");
menu._prefix.add('u');
expect(menu.show()).toBe(true);
expect(menu.prefix()).toEqual("au");
expect(menu.shownItem(0).name()).toEqual("Autor");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong><mark>Au</mark>tor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong><mark>Au</mark>tor</strong>");
menu._prefix.chop();
expect(menu.show()).toBe(true);
expect(menu.prefix()).toEqual("a");
expect(menu.shownItem(0).name()).toEqual("Autor");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong><mark>A</mark>utor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong><mark>A</mark>utor</strong>");
menu._prefix.chop();
expect(menu.show()).toBe(true);
expect(menu.prefix()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
expect(menu.shownItem(3)).toBe(undefined);
@@ -935,26 +935,26 @@
expect(menu.show()).toBe(true);
expect(menu.prefix()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
// Forward
menu.next();
expect(menu.prefix()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
expect(menu.shownItem(3)).toBe(undefined);
@@ -962,13 +962,13 @@
menu.next();
expect(menu.prefix()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(true);
expect(menu.shownItem(3)).toBe(undefined);
@@ -976,13 +976,13 @@
menu.next();
expect(menu.prefix()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Länge");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Länge</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Länge</strong>");
expect(menu.shownItem(2).active()).toBe(true);
expect(menu.shownItem(3)).toBe(undefined);
@@ -990,13 +990,13 @@
menu.next();
expect(menu.prefix()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Länge");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Länge</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Länge</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Autor");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Autor</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Autor</strong>");
expect(menu.shownItem(2).active()).toBe(true);
expect(menu.shownItem(3)).toBe(undefined);
@@ -1004,13 +1004,13 @@
menu.next();
expect(menu.prefix()).toEqual("");
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Titel</strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertitel</strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2).name()).toEqual("Veröffentlichungsdatum");
- expect(menu.element().getElementsByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
+ expect(menu.directElementChildrenByTagName("li")[2].innerHTML).toEqual("<strong>Veröffentlichungsdatum</strong>");
expect(menu.shownItem(2).active()).toBe(false);
});
@@ -1031,10 +1031,10 @@
expect(menu.prefix()).toEqual("El");
expect(menu._prefix.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1043,10 +1043,10 @@
expect(menu.prefix()).toEqual("El");
expect(menu._prefix.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1055,10 +1055,10 @@
expect(menu.prefix()).toEqual("El");
expect(menu._prefix.active()).toEqual(true);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1067,11 +1067,11 @@
expect(menu.prefix()).toEqual("El");
expect(menu._prefix.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
});
@@ -1090,10 +1090,10 @@
expect(menu.prefix()).toEqual("el");
expect(menu._prefix.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1102,11 +1102,11 @@
expect(menu._prefix.active()).toEqual(true);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1114,10 +1114,10 @@
menu.prev();
expect(menu._prefix.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(true);
expect(menu.shownItem(2)).toBe(undefined);
});
@@ -1134,10 +1134,10 @@
expect(menu.prefix()).toEqual("el");
expect(menu._prefix.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1145,10 +1145,10 @@
menu.prev();
expect(menu._prefix.active()).toEqual(true);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(false);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);
@@ -1158,10 +1158,10 @@
expect(menu.prefix()).toEqual("el");
expect(menu._prefix.active()).toEqual(false);
expect(menu.shownItem(0).name()).toEqual("Titel");
- expect(menu.element().getElementsByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[0].innerHTML).toEqual("<strong>Tit<mark>el</mark></strong>");
expect(menu.shownItem(0).active()).toBe(true);
expect(menu.shownItem(1).name()).toEqual("Untertitel");
- expect(menu.element().getElementsByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
+ expect(menu.directElementChildrenByTagName("li")[1].innerHTML).toEqual("<strong>Untertit<mark>el</mark></strong>");
expect(menu.shownItem(1).active()).toBe(false);
expect(menu.shownItem(2)).toBe(undefined);