Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 43842e8

Browse files
committed
test(input): added drop event support
1 parent 686390f commit 43842e8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/ng/directive/inputSpec.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ describe('input', function() {
440440
}
441441
});
442442

443-
describe('"keydown", "paste" and "cut" events', function() {
443+
describe('"keydown", "paste", "cut" and "drop" events', function() {
444444
beforeEach(function() {
445445
// Force browser to report a lack of an 'input' event
446446
$sniffer.hasEvent = function(eventName) {
@@ -462,6 +462,18 @@ describe('input', function() {
462462
expect($rootScope.name).toEqual('mark');
463463
});
464464

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+
});
465477

466478
it('should update the model on "cut" event', function() {
467479
var inputElm = helper.compileInput('<input type="text" ng-model="name" name="alias" ng-change="change()" />');

0 commit comments

Comments
 (0)