Finalized tree view / removed d3
diff --git a/public/js/spec/matchInfoSpec.js b/public/js/spec/matchInfoSpec.js
index c25a0c9..b228413 100644
--- a/public/js/spec/matchInfoSpec.js
+++ b/public/js/spec/matchInfoSpec.js
@@ -237,9 +237,6 @@
var tree = info.getTree();
expect(tree).toBeTruthy();
expect(tree.nodes()).toEqual(49);
-
- console.log(tree.element());
-
});
});
@@ -292,7 +289,7 @@
});
});
-xdescribe('KorAP.MatchTree', function () {
+describe('KorAP.MatchTree', function () {
it('should be rendered', function () {
var info = KorAP.MatchInfo.create(match, available);
@@ -302,7 +299,34 @@
};
var tree = info.getTree();
- tree.element();
+
+ var e = tree.element();
+ expect(e.nodeName).toEqual('svg');
+ expect(e.getElementsByTagName('g').length).toEqual(48);
+ });
+});
+
+describe('KorAP.MatchTreeItem', function () {
+ it('should be initializable', function () {
+ var mi = KorAP.MatchTreeItem.create(['cnx/c', 'cnx', 'c'])
+ expect(mi.element().firstChild.nodeValue).toEqual('cnx/c');
+ expect(mi.lcField()).toEqual(' cnx/c');
+ expect(mi.foundry()).toEqual('cnx');
+ expect(mi.layer()).toEqual('c');
+ });
+});
+
+describe('KorAP.MatchTreeMenu', function () {
+ it('should be initializable', function () {
+ var menu = KorAP.MatchTreeMenu.create([
+ ['cnx/c', 'cnx', 'c'],
+ ['xip/c', 'xip', 'c']
+ ]);
+
+ expect(menu.itemClass()).toEqual(KorAP.MatchTreeItem);
+ expect(menu.element().nodeName).toEqual('UL');
+ expect(menu.element().style.opacity).toEqual("0");
+ expect(menu.limit()).toEqual(6);
});
});
diff --git a/public/js/spec/menuSpec.js b/public/js/spec/menuSpec.js
index 08fea76..7419f83 100644
--- a/public/js/spec/menuSpec.js
+++ b/public/js/spec/menuSpec.js
@@ -154,6 +154,11 @@
expect(mi.lcField()).toEqual(' baum');
});
+ it('shouldn\'t have a reference to the menu', function () {
+ var menuItem = KorAP.OwnMenuItem.create(['Test']);
+ expect(menuItem.menu()).toBe(undefined);
+ });
+
it('should be activatable and deactivateable by class', function () {
var menuItem = KorAP.OwnMenuItem.create(['Test']);
@@ -376,6 +381,15 @@
expect(menu.item(menu.length() - 1).noMore()).toBe(true);
});
+ it('should have a reference to the menu', function () {
+ var menu = KorAP.HintMenu.create("cnx/", list);
+ expect(menu.item(0).menu()).toEqual(menu);
+
+ menu = KorAP.HintMenu.create("cnx/", list);
+ expect(menu.element().menu).toEqual(menu);
+ });
+
+
it('should be visible', function () {
var menu = KorAP.HintMenu.create("cnx/", list);
expect(menu.delete()).toBe(undefined);
@@ -1035,8 +1049,6 @@
});
- it('should be page downable', function () {
-
- });
+ xit('should be page downable');
xit('should be page upable');
});