Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding in escape key specs

  • Loading branch information...
commit 38faa362428f0f008c6f4a4793aa3b0b14b7e48c 1 parent 3b5a927
@digitalBush digitalBush authored
Showing with 24 additions and 0 deletions.
  1. +23 −0 spec/Escape.Spec.js
  2. +1 −0  spec/SpecRunner.html
View
23 spec/Escape.Spec.js
@@ -0,0 +1,23 @@
+feature("Escape Key", function() {
+ story('User presses escape key after typing in some changes',function(){
+ scenario('mask is applied with an existing value',function(){
+ given("an input an existing value '6'", function(){
+ input
+ .val('6');
+ });
+
+ given("a mask definition of '9'", function(){
+ input
+ .mask('9').focus();
+ });
+ waits(1);
+ when("user types something different then hits escape key",function(){
+ input.mashKeys(function(keys){keys.type('1',keys.esc)});
+ });
+
+ then("value is return to previous value",function(){
+ expect(input).toHaveValue('6');
+ });
+ });
+ });
+});
View
1  spec/SpecRunner.html
@@ -45,6 +45,7 @@
<script type="text/javascript" src="Typing.Spec.js"></script>
<script type="text/javascript" src="Backspace.Spec.js"></script>
<script type="text/javascript" src="Delete.Spec.js"></script>
+ <script type="text/javascript" src="Escape.Spec.js"></script>
</head>
<body>
Please sign in to comment.
Something went wrong with that request. Please try again.