From 8b9e6c3501746edb2c9e2d585e8e0eaeb8ba8327 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 16 Jan 2013 10:51:24 -0800 Subject: 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 --- test/ngScenario/dslSpec.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'test/ngScenario') diff --git a/test/ngScenario/dslSpec.js b/test/ngScenario/dslSpec.js index 2db2771c..e955b017 100644 --- a/test/ngScenario/dslSpec.js +++ b/test/ngScenario/dslSpec.js @@ -269,7 +269,7 @@ describe("angular.scenario.dsl", function() { $root.dsl.select('test').options('A', 'B'); expect($root.futureError).toMatch(/did not match/); }); - + it('should fail to select an option that does not exist', function(){ doc.append( ''); - 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('')($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(''); -- cgit v1.2.3