From 9c0225512c63ebfc37e6408cc155d9da1fe682c9 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 26 Oct 2010 15:35:58 -0700 Subject: fixes IE related failures, and form submit event handling in ie --- example/personalLog/personalLog.js | 10 ++-- scenario/widgets-scenario.js | 12 ++++- scenario/widgets.html | 9 ++-- src/scenario/Scenario.js | 9 ++++ src/scenario/output/Xml.js | 36 +++++++------- src/widgets.js | 4 -- test/directivesSpec.js | 2 +- test/manual.html | 97 ++++++++++++++++++++++++-------------- test/scenario/ApplicationSpec.js | 2 +- test/scenario/dslSpec.js | 2 +- test/scenario/output/HtmlSpec.js | 4 +- test/scenario/output/jsonSpec.js | 10 ++-- test/scenario/output/objectSpec.js | 8 ++-- test/scenario/output/xmlSpec.js | 12 ++--- 14 files changed, 131 insertions(+), 86 deletions(-) diff --git a/example/personalLog/personalLog.js b/example/personalLog/personalLog.js index c0273036..da946a6f 100644 --- a/example/personalLog/personalLog.js +++ b/example/personalLog/personalLog.js @@ -1,5 +1,5 @@ /** - * @fileOverview Very simple personal log demo application to demostrate angular functionality, + * @fileOverview Very simple personal log demo application to demonstrate angular functionality, * especially: * - the MVC model * - testability of controllers @@ -46,7 +46,7 @@ function LogCtrl($cookieStore) { logs.push(log); $cookieStore.put(LOGS, logs); self.newMsg = ''; - } + }; /** @@ -56,16 +56,16 @@ function LogCtrl($cookieStore) { this.rmLog = function(msgIdx) { logs.splice(msgIdx,1); $cookieStore.put(LOGS, logs); - } + }; /** * Persistently removes all logs. */ this.rmLogs = function() { - logs.splice(0); + logs.splice(0, logs.length); $cookieStore.remove(LOGS); - } + }; } //inject diff --git a/scenario/widgets-scenario.js b/scenario/widgets-scenario.js index ba3ef3cf..7e8b8ade 100644 --- a/scenario/widgets-scenario.js +++ b/scenario/widgets-scenario.js @@ -27,12 +27,22 @@ describe('widgets', function() { expect(binding('multiselect').fromJson()).toEqual(['A', 'C']); expect(binding('button').fromJson()).toEqual({'count': 0}); + expect(binding('form').fromJson()).toEqual({'count': 0}); + element('form a').click(); expect(binding('button').fromJson()).toEqual({'count': 1}); - element('input[value="submit"]').click(); + + element('input[value="submit input"]').click(); + expect(binding('button').fromJson()).toEqual({'count': 2}); + expect(binding('form').fromJson()).toEqual({'count': 1}); + + element('button:contains("submit button")').click(); expect(binding('button').fromJson()).toEqual({'count': 2}); + expect(binding('form').fromJson()).toEqual({'count': 2}); + element('input[value="button"]').click(); expect(binding('button').fromJson()).toEqual({'count': 3}); + element('input[type="image"]').click(); expect(binding('button').fromJson()).toEqual({'count': 4}); diff --git a/scenario/widgets.html b/scenario/widgets.html index a520a326..adf2fa27 100644 --- a/scenario/widgets.html +++ b/scenario/widgets.html @@ -73,15 +73,16 @@