Introduce fieldType guesser in VC deserialization
Change-Id: Id279582a5e238e3fb494ca0706783a57b47c05ce
diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index 5433fb1..8e745e1 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -2233,6 +2233,22 @@
// blur
document.body.click();
});
+
+
+ // Check json deserialization
+ it('should be initializable', function () {
+ vc = vcClass.create([
+ ['a', 'text'],
+ ['b', 'string'],
+ ['c', 'date']
+ ]).fromJson({
+ "@type" : "koral:doc",
+ "key":"a",
+ "value":"Baum"
+ });
+
+ expect(vc.element().firstChild.children[1].getAttribute('data-type')).toEqual('text');
+ });
});