You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mw...@apache.org on 2012/07/13 08:15:41 UTC
[5/14] git commit: Add report functionality.
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 <mi...@michaelbrooks.ca>
Authored: Thu Jul 12 22:30:00 2012 -0700
Committer: Michael Brooks <mi...@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');
+ });
});
});