Improve RegEx button in vc builder
Change-Id: Iea748a41b78e4112a1e884b9b0ca6be05c5332e8
diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index 83ee822..bfdf9fa 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -2824,10 +2824,17 @@
});
it('should have a classed element', function () {
- var sv = stringValClass.create();
+ const sv = stringValClass.create();
expect(sv.element().classList.contains('regex')).toBe(false);
expect(sv.regex()).toBe(false);
- sv.toggleRegex();
+
+ const re = sv.element().children[1];
+ expect(re.textContent).toEqual('RegEx');
+ expect(re.getAttribute("title")).toEqual('Use as regular expression');
+
+ // Run event instead toggleRegex()
+ re.click();
+
expect(sv.element().classList.contains('regex')).toBe(true);
});