incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwbro...@apache.org
Subject [5/14] git commit: Add report functionality.
Date Fri, 13 Jul 2012 06:15:41 GMT
Add report functionality.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/commit/3fe9c136
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/3fe9c136
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/3fe9c136

Branch: refs/heads/hello-cordova
Commit: 3fe9c13645b138c68d36568ae9b336a113707d52
Parents: ace0f12
Author: Michael Brooks <michael@michaelbrooks.ca>
Authored: Thu Jul 12 22:30:00 2012 -0700
Committer: Michael Brooks <michael@michaelbrooks.ca>
Committed: Thu Jul 12 22:30:00 2012 -0700

----------------------------------------------------------------------
 www/js/index.js   |    1 +
 www/spec/index.js |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/3fe9c136/www/js/index.js
----------------------------------------------------------------------
diff --git a/www/js/index.js b/www/js/index.js
index 4f26c5a..ce8d9b2 100644
--- a/www/js/index.js
+++ b/www/js/index.js
@@ -11,5 +11,6 @@ var app = {
         }
     },
     report: function(id) {
+        document.getElementById(id).innerHTML= 'ok';
     }
 };

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/3fe9c136/www/spec/index.js
----------------------------------------------------------------------
diff --git a/www/spec/index.js b/www/spec/index.js
index d110193..930fe85 100644
--- a/www/spec/index.js
+++ b/www/spec/index.js
@@ -59,5 +59,11 @@ describe('app', function() {
         it('should exist', function() {
             expect(app.report).toBeDefined();
         });
+
+        it('should report "ok" for the given ID', function() {
+            document.getElementById('stage').innerHTML = '<span id="deviceready"></span>';
+            app.report('deviceready');
+            expect(document.getElementById('deviceready').innerHTML).toEqual('ok');
+        });
     });
 });


Mime
View raw message