Skip to content

Commit 0c35c11

Browse files
committed
Datepicker: Corrected tests for changes in r3494
1 parent 9a786e0 commit 0c35c11

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/unit/datepicker/datepicker_options.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,17 @@ test('altField', function() {
510510
equals(alt.val(), '', 'Alt field - alt - ctrl+end');
511511
// Verify alt field is updated on keyup
512512
alt.val('');
513-
inp.val('06/04/2008').datepicker('show');
514-
inp.simulate('keyup', {keyCode: $.simulate.VK_ENTER});
513+
inp.val('06/04/200').datepicker('show');
514+
inp.simulate('keydown', {charCode: '8'.charCodeAt(0)});
515+
inp.simulate('keypress', {charCode: '8'.charCodeAt(0)});
516+
inp.simulate('keyup', {charCode: '8'.charCodeAt(0)});
515517
equals(inp.val(), '06/04/2008', 'Alt field - dp - manual entry');
516518
equals(alt.val(), '2008-06-04', 'Alt field - manual entry');
517519
// Verify alt field is not updated on keyup if date is invalid
518-
inp.val('12/04/');
519-
inp.simulate('keyup', {keyCode: $.simulate.VK_ENTER});
520+
inp.val('12/04');
521+
inp.simulate('keydown', {charCode: '/'.charCodeAt(0)});
522+
inp.simulate('keypress', {charCode: '/'.charCodeAt(0)});
523+
inp.simulate('keyup', {charCode: '/'.charCodeAt(0)});
520524
equals(inp.val(), '12/04/', 'Alt field - dp - manual entry incomplete');
521525
equals(alt.val(), '2008-06-04', 'Alt field - manual entry - not updated');
522526
});

0 commit comments

Comments
 (0)