diff options
| author | Igor Minar | 2013-01-16 10:51:24 -0800 | 
|---|---|---|
| committer | Igor Minar | 2013-01-16 23:30:16 -0800 | 
| commit | 92c612a9deac6e311bc2c632d373d525bf9017a0 (patch) | |
| tree | 034b87b3b8f6bf1e5fdf66bd20f58c48738e33c2 /test/ngScenario/dslSpec.js | |
| parent | a7b53abcada014cbea59cb94d8b1e82c0058d09b (diff) | |
| download | angular.js-92c612a9deac6e311bc2c632d373d525bf9017a0.tar.bz2 | |
fix(scenario): don't trigger input events on IE9
input.enter() should trigger 'change' rather than 'input' event on IE9 because
input events on IE9 are broken and angular doesn't rely on them
Diffstat (limited to 'test/ngScenario/dslSpec.js')
| -rw-r--r-- | test/ngScenario/dslSpec.js | 23 | 
1 files changed, 17 insertions, 6 deletions
diff --git a/test/ngScenario/dslSpec.js b/test/ngScenario/dslSpec.js index 6d87e850..80778c21 100644 --- a/test/ngScenario/dslSpec.js +++ b/test/ngScenario/dslSpec.js @@ -269,6 +269,7 @@ describe("angular.scenario.dsl", function() {          $root.dsl.select('test').options('A', 'B');          expect($root.futureError).toMatch(/did not match/);        }); +      });      describe('Element', function() { @@ -553,12 +554,22 @@ describe("angular.scenario.dsl", function() {      });      describe('Input', function() { -      it('should change value in text input', function() { -        doc.append('<input ng-model="test.input" value="something">'); -        var chain = $root.dsl.input('test.input'); -        chain.enter('foo'); -        expect(_jQuery('input[ng-model="test.input"]').val()).toEqual('foo'); -      }); +      it('should change value in text input', inject(function($compile) { +        runs(function() { +          element = $compile('<input ng-model="test.input" value="something">')($root); +          doc.append(element); +          var chain = $root.dsl.input('test.input'); +          chain.enter('foo'); +          expect(_jQuery('input[ng-model="test.input"]').val()).toEqual('foo'); +        }); + +        // cleanup the event queue +        waits(0); + +        runs(function() { +          expect($root.test.input).toBe('foo'); +        }); +      }));        it('should change value in text input in dash form', function() {          doc.append('<input ng-model="test.input" value="something">');  | 
