aboutsummaryrefslogtreecommitdiffstats
path: root/test/widget/inputSpec.js
diff options
context:
space:
mode:
authorbartes2011-11-18 20:10:04 +0100
committerIgor Minar2011-12-07 13:07:20 -0800
commit0c534644bc1908fad4e8df5754d3ec224bc7ed7e (patch)
tree86fb935fc984b1f9ecbae2ed66e1e62f348bf33d /test/widget/inputSpec.js
parentc28662d28dec613876bebacb2df994722c09f3fb (diff)
downloadangular.js-0c534644bc1908fad4e8df5754d3ec224bc7ed7e.tar.bz2
fix(input): bind inputs to the 'input' event
The input event is fired on all non-ie browsers whenever the contents of an input field changes. This means that we now support cut&paste via mouse which was previously unsupported. IE8 and older don't support this events and IE9 has a problematic support for it, so we can't rely solely on this event and drop keydown and change events.
Diffstat (limited to 'test/widget/inputSpec.js')
-rw-r--r--test/widget/inputSpec.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js
index dfbc506a..e8b0a420 100644
--- a/test/widget/inputSpec.js
+++ b/test/widget/inputSpec.js
@@ -112,7 +112,7 @@ describe('widget: input', function() {
describe("input", function() {
describe("text", function() {
- it('should input-text auto init and handle keydown/change events', function() {
+ it('should input-text auto init and listen on keydown/change/input events', function() {
compile('<input type="text" ng:model="name"/>');
scope.name = 'Adam';
@@ -130,6 +130,13 @@ describe('widget: input', function() {
browserTrigger(element, 'change');
defer.flush();
expect(scope.name).toEqual('Kai');
+
+ if (!(msie<=8)) {
+ element.val('Lunar');
+ browserTrigger(element, 'input');
+ defer.flush();
+ expect(scope.name).toEqual('Lunar');
+ }
});