alpaca
Version:
Alpaca provides the easiest and fastest way to generate interactive forms for the web and mobile devices. It runs simply as HTML5 or more elaborately using Bootstrap, jQuery Mobile or jQuery UI. Alpaca uses Handlebars to process JSON schema and provide
57 lines (47 loc) • 1.24 kB
JavaScript
feature("Getting raw value",function(){
scenario("After typing",function(){
given("an input with a mask containing a literal", function(){
input
.mask("9/9");
});
when("typing all numbers",function(){
input.mashKeys("12");
});
then("raw value should be correct",function(){
expect(input.mask()).toEqual("12");
});
});
scenario("While typing",function(){
given("an input with a mask containing a literal", function(){
input
.mask("9/9");
});
when("typing a number",function(){
input.mashKeys("1");
});
then("raw value should be correct",function(){
expect(input.mask()).toEqual("1");
});
});
scenario("Before typing",function(){
given("an input with a mask containing a literal", function(){
input
.mask("9/9");
});
then("raw value should be correct",function(){
expect(input.mask()).toEqual("");
});
});
scenario("After typing partial input past an optional marker",function(){
given("an input with a mask containing a literal", function(){
input
.mask("9?99");
});
when("typing a partial input",function(){
input.mashKeys("12");
});
then("raw value should be correct",function(){
expect(input.mask()).toEqual("12");
});
});
});