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

Commit

Permalink
test(input): add test for IE composition bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Narretz authored and jileeon committed Jan 25, 2018
1 parent 63ad1aa commit 4a5283b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/ng/directive/inputSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ describe('input', function() {
browserTrigger(inputElm, 'compositionend');
expect($rootScope.name).toEqual('caitp');
});


it('should end composition on "compositionupdate" when event.data is ""', function() {
// This tests a bug workaround for IE9-11
// During composition, when an input is de-focussed by clicking away from it,
// the compositionupdate event is called with '', followed by a change event.
var inputElm = helper.compileInput('<input type="text" ng-model="name" name="alias" />');
browserTrigger(inputElm, 'compositionstart');
helper.changeInputValueTo('caitp');
expect($rootScope.name).toBeUndefined();
browserTrigger(inputElm, 'compositionupdate', {data: ''});
browserTrigger(inputElm, 'change');
expect($rootScope.name).toEqual('caitp');
});
});


Expand Down

0 comments on commit 4a5283b

Please sign in to comment.