This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ describe('input', function() {
439
439
}
440
440
} ) ;
441
441
442
- describe ( '"keydown", "paste" and "cut " events' , function ( ) {
442
+ describe ( '"keydown", "paste", "cut" and "drop " events' , function ( ) {
443
443
beforeEach ( function ( ) {
444
444
// Force browser to report a lack of an 'input' event
445
445
$sniffer . hasEvent = function ( eventName ) {
@@ -461,6 +461,18 @@ describe('input', function() {
461
461
expect ( $rootScope . name ) . toEqual ( 'mark' ) ;
462
462
} ) ;
463
463
464
+ it ( 'should update the model on "drop" event if the input value changes' , function ( ) {
465
+ var inputElm = helper . compileInput ( '<input type="text" ng-model="name" name="alias" ng-change="change()" />' ) ;
466
+
467
+ browserTrigger ( inputElm , 'keydown' ) ;
468
+ $browser . defer . flush ( ) ;
469
+ expect ( inputElm ) . toBePristine ( ) ;
470
+
471
+ inputElm . val ( 'mark' ) ;
472
+ browserTrigger ( inputElm , 'drop' ) ;
473
+ $browser . defer . flush ( ) ;
474
+ expect ( $rootScope . name ) . toEqual ( 'mark' ) ;
475
+ } ) ;
464
476
465
477
it ( 'should update the model on "cut" event' , function ( ) {
466
478
var inputElm = helper . compileInput ( '<input type="text" ng-model="name" name="alias" ng-change="change()" />' ) ;
You can’t perform that action at this time.
0 commit comments