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 @@ -440,7 +440,7 @@ describe('input', function() {
440
440
}
441
441
} ) ;
442
442
443
- describe ( '"keydown", "paste" and "cut " events' , function ( ) {
443
+ describe ( '"keydown", "paste", "cut" and "drop " events' , function ( ) {
444
444
beforeEach ( function ( ) {
445
445
// Force browser to report a lack of an 'input' event
446
446
$sniffer . hasEvent = function ( eventName ) {
@@ -462,6 +462,18 @@ describe('input', function() {
462
462
expect ( $rootScope . name ) . toEqual ( 'mark' ) ;
463
463
} ) ;
464
464
465
+ it ( 'should update the model on "drop" event if the input value changes' , function ( ) {
466
+ var inputElm = helper . compileInput ( '<input type="text" ng-model="name" name="alias" ng-change="change()" />' ) ;
467
+
468
+ browserTrigger ( inputElm , 'keydown' ) ;
469
+ $browser . defer . flush ( ) ;
470
+ expect ( inputElm ) . toBePristine ( ) ;
471
+
472
+ inputElm . val ( 'mark' ) ;
473
+ browserTrigger ( inputElm , 'drop' ) ;
474
+ $browser . defer . flush ( ) ;
475
+ expect ( $rootScope . name ) . toEqual ( 'mark' ) ;
476
+ } ) ;
465
477
466
478
it ( 'should update the model on "cut" event' , function ( ) {
467
479
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