Show rewrite on overview
Change-Id: I93d0a31445430ea394c058b2d7685d86f056edd4
diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index 6f2c391..3159101 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -1857,7 +1857,54 @@
});
});
+ // Check class method
+ describe('KorAP.VC.checkRewrite', function () {
+
+ it('should check for simple rewrites', function () {
+ expect(vcClass.checkRewrite(
+ {
+ "@type" : "koral:doc",
+ "rewrites" : [{
+ "@type" : "koral:rewrite",
+ "operation" : "operation:modification",
+ "src" : "querySerializer",
+ "scope" : "tree"
+ }]
+ }
+ )).toBeTruthy();
+ var nested = {
+ "@type" : "koral:docGroup",
+ "operands" : [
+ {
+ "@type" : "koral:doc"
+ },
+ {
+ "@type" : "koral:docGroup",
+ "operands" : [
+ {
+ "@type": "koral:doc"
+ },
+ {
+ "@type": "koral:doc"
+ }
+ ]
+ }
+ ]
+ };
+
+ expect(vcClass.checkRewrite(nested)).toBe(false);
+
+ nested["operands"][1]["operands"][1]["rewrites"] = [{
+ "@type" : "koral:rewrite",
+ "operation" : "operation:modification",
+ "src" : "querySerializer",
+ "scope" : "tree"
+ }];
+
+ expect(vcClass.checkRewrite(nested)).toBeTruthy();
+ });
+ });
describe('KorAP.Rewrite', function () {
it('should be initializable', function () {