cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From audre...@apache.org
Subject cordova-lib git commit: CB-12361 : added tests for plugin/search.js and rebased
Date Fri, 11 Aug 2017 17:37:55 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 2dc7fe1a7 -> f399c739b


CB-12361 : added tests for plugin/search.js and rebased


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/f399c739
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/f399c739
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/f399c739

Branch: refs/heads/master
Commit: f399c739bc6ed2a6dcc96eff8bd93a058e5122a8
Parents: 2dc7fe1
Author: Audrey So <audreyso@apache.org>
Authored: Thu Jul 20 13:23:11 2017 -0700
Committer: Audrey So <audreyso@apache.org>
Committed: Fri Aug 11 10:21:10 2017 -0700

----------------------------------------------------------------------
 spec/cordova/plugin/search.spec.js | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f399c739/spec/cordova/plugin/search.spec.js
----------------------------------------------------------------------
diff --git a/spec/cordova/plugin/search.spec.js b/spec/cordova/plugin/search.spec.js
index 33e4d48..02eaaa1 100644
--- a/spec/cordova/plugin/search.spec.js
+++ b/spec/cordova/plugin/search.spec.js
@@ -44,7 +44,34 @@ describe('cordova/plugin/search', function () {
             console.error(e);
         }).done(done);
     });
-    it('should open a link to cordova.apache.org/plugins if no plugins are provided as parameter');
-    it('should open a link to cordova.apache.org/plugins, providing the plugins passed in
as a query-string parameter');
-    it('should fire the after_plugin_search hook');
+
+    it('should open a link to cordova.apache.org/plugins if no plugins are provided as parameter',
function (done) {
+        var opts = {important: 'options', plugins: []};
+        search(hook_mock, opts).then(function () {
+            expect(opener_mock).toHaveBeenCalled();
+        }).fail(function (e) {
+            fail('fail handler unexpectedly invoked');
+            console.error(e);
+        }).done(done);
+    });
+
+    it('should open a link to cordova.apache.org/plugins, providing the plugins passed in
as a query-string parameter', function (done) {
+        var opts = {important: 'options', plugins: ['cordova-plugin-camera', 'cordova-plugin-splashscreen']};
+        search(hook_mock, opts).then(function () {
+            expect(opener_mock).toHaveBeenCalled();
+        }).fail(function (e) {
+            fail('fail handler unexpectedly invoked');
+            console.error(e);
+        }).done(done);
+    });
+
+    it('should fire the after_plugin_search hook', function (done) {
+        var opts = {important: 'options', plugins: []};
+        search(hook_mock, opts).then(function () {
+            expect(hook_mock.fire).toHaveBeenCalledWith('after_plugin_search', opts);
+        }).fail(function (e) {
+            fail('fail handler unexpectedly invoked');
+            console.error(e);
+        }).done(done);
+    });
 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message