Add report functionality.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/commit/3fe9c136 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/tree/3fe9c136 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/diff/3fe9c136 Branch: refs/heads/master Commit: 3fe9c13645b138c68d36568ae9b336a113707d52 Parents: ace0f12 Author: Michael Brooks <mich...@michaelbrooks.ca> Authored: Thu Jul 12 22:30:00 2012 -0700 Committer: Michael Brooks <mich...@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-app-hello-world/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-app-hello-world/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'); + }); }); });