Jasmine
1.0.1 revision 1286311016
Show
passed
skipped
run all
30 specs, 0 failures in 0.2s
Finished at Sun Mar 16 2025 17:39:18 GMT+0000 (Coordinated Universal Time)
run
Feature: Masking an Input
run
Scenario: Applying a mask to an already masked input
Given an input with two masks
When typing a number
Then value should be correct
run
Feature: Getting raw value
run
Scenario: After typing
Given an input with a mask containing a literal
When typing all numbers
Then raw value should be correct
run
Scenario: While typing
Given an input with a mask containing a literal
When typing a number
Then raw value should be correct
run
Scenario: Before typing
Given an input with a mask containing a literal
Then raw value should be correct
run
Scenario: After typing partial input past an optional marker
Given an input with a mask containing a literal
When typing a partial input
Then raw value should be correct
run
Feature: Focusing A Masked Input
run
Scenario: Mask starts with a placeholder
Given a mask beginning with a placeholder
When focusing
Then placeholder text should be correct
And caret position should be correct
run
Scenario: Mask starts with a literal
Given a mask beginning with a literal
When focusing
Then placeholder text should be correct
And caret position should be correct
run
Scenario: Masking a hidden input
Given a mask on a hidden input
When focusing input
Then should not throw an error
run
Feature: Leaving A Masked Input
run
Scenario: All placeholders filled
Given a mask with two placeholders
When typing two characters and blurring
Then value should be correct
run
Scenario: Empty placeholders remaining
Given a mask with two placeholders
When typing one character and blurring
Then value should be empty
run
Feature: Optional marker
run
Scenario: Placeholders not filled to marker
Given a mask with an optional marker
When typing one character and leaving
Then value should be empty
run
Scenario: Placeholders filled to marker
Given a mask with an optional marker
When typing two characters and leaving
Then value should remain
run
Typing Specifications
run
with caret position to the left of a character
run
when character to right matches the next mask definition
run
should shift character to the right
run
should have correct caret position
run
when character to right does not match the next mask definition
run
should overwrite character
run
should have correct caret position
run
Feature: Backspace Key
run
Story: User presses backspace with cursor to the right of a mask literal
run
Scenario: character at cursor matches definition to the left
Given an input with a mask definition of '9-99'
Given the input has cursor positioned to the right of literal
When hitting the backspace key
Then value should be correct
And caret position should be correct
run
Scenario: character at cursor does not match definition to the left
Given an input with a mask definition of 'a-99'
Given the input has cursor positioned to the right of literal
When hitting the backspace key
Then value should be correct
And caret position should be correct
run
Story: User presses backspace with cursor on last character
run
There is a mask literal between the two placeholders
run
Scenario: character at end matches definition of first position
Given an input with a mask definition of '9-9'
Given the input has cursor positioned on literal
When hitting the backspace key
Then value should be correct
And caret position should be correct
run
Scenario: character at end does not match definition of first position
Given an input with a mask definition of '9-9'
Given the input has cursor positioned on literal
When hitting the backspace key
Then value should be correct
And caret position should be correct
run
Scenario: cursor character matches definition to the left
Given an input with a mask definition of '99'
Given the input has cursor positioned on first character
When hitting the backspace key
Then value should be correct
And caret position should be correct
run
Scenario: cursor character does not match definition to the left
Given an input with a mask definition of '9a'
Given the input has cursor positioned on first character
When hitting the backspace key
Then value should be correct
And caret position should be correct
run
Feature: Delete Key
run
Story: User presses delete with cursor on a mask literal
run
Scenario: character at end matches definition to the right
Given an input with a mask definition of '9-99'
Given the input has cursor positioned on literal
When hitting the delete key
Then value should be correct
And caret position should be correct
run
Scenario: character at end does not match definition to the right
Given an input with a mask definition of '9-9a'
Given the input has cursor positioned on literal
When hitting the delete key
Then value should be correct
And caret position should be correct
run
Story: User presses delete with cursor on first character
run
There is a mask literal between the two placeholders
run
Scenario: character to right matches definition of current position
Given an input with a mask definition of '9-9'
Given the input has cursor positioned on first character
When hitting the delete key
Then value should be correct
And caret position should be correct
run
Scenario: character to right does not match definition of current position
Given an input with a mask definition of '9-9'
Given the input has cursor positioned on first character
When hitting the delete key
Then value should be correct
And caret position should be correct
run
Scenario: character to right matches definition of current position
Given an input with a mask definition of '99'
Given the input has cursor positioned on first character
When hitting the delete key
Then value should be correct
And caret position should be correct
run
Scenario: character to right does not match definition of current position
Given an input with a mask definition of '9a'
Given the input has cursor positioned on first character
When hitting the delete key
Then value should be correct
And caret position should be correct
run
Feature: Escape Key
run
Story: User presses escape key after typing in some changes
run
Scenario: mask is applied with an existing value
Given an input an existing value '6'
Given a mask definition of '9'
When user types something different then hits escape key
Then value is return to previous value
run
Feature: Pasting
run
Scenario: When pasting a value
Given an input with a completed callback
When pasting
Then completed callback should be called