Fix constraint removal in VC fragment
Change-Id: I979513cb6bd43b8fca1e96585977d0b014692d50
diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index bab1747..61c3099 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -2872,6 +2872,7 @@
});
});
+ // Check fragment handling for corpusByMatch helper
describe('KorAP.VC.Fragment', function () {
it('should be initializable', function () {
var f = fragmentClass.create();
@@ -2923,10 +2924,15 @@
it('should be reducible', function () {
var f = fragmentClass.create();
+ expect(f.element().children.length).toEqual(0);
+
f.add("author", "Peter");
f.add("title", "Example");
+ expect(f.element().children.length).toEqual(1);
+
var root = f.element().firstChild;
+
expect(root.classList.contains("docGroup")).toBeTruthy();
expect(root.children.length).toEqual(2);
@@ -2942,6 +2948,10 @@
expect(root.children[1].textContent).toEqual("eq");
expect(root.children[2].tagName).toEqual("SPAN");
expect(root.children[2].textContent).toEqual("Example");
+
+ f.remove("title","Example");
+
+ expect(f.element().children.length).toEqual(0);
});
});
});