Updated Branches: refs/heads/master 100b954da -> 579475ee5
Provide a test case for CB-3522 which is broken on WP8 Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/579475ee Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/579475ee Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/579475ee Branch: refs/heads/master Commit: 579475ee5e9ed7c77890538a8c6bddaa6801face Parents: 100b954 Author: Kevin Boyle <[email protected]> Authored: Sun Jun 9 15:04:01 2013 +0100 Committer: Jesse MacFadyen <[email protected]> Committed: Mon Jun 10 16:12:52 2013 -0700 ---------------------------------------------------------------------- autotest/tests/contacts.tests.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/579475ee/autotest/tests/contacts.tests.js ---------------------------------------------------------------------- diff --git a/autotest/tests/contacts.tests.js b/autotest/tests/contacts.tests.js index 12520a4..6d03e45 100644 --- a/autotest/tests/contacts.tests.js +++ b/autotest/tests/contacts.tests.js @@ -64,6 +64,26 @@ describe("Contacts (navigator.contacts)", function () { expect(fail).not.toHaveBeenCalled(); }); }); + + it("success callback should be called with an array, even if partial ContactFindOptions specified", function () { + var win = jasmine.createSpy().andCallFake(function (result) { + expect(result).toBeDefined(); + expect(result instanceof Array).toBe(true); + }), + fail = jasmine.createSpy(); + + runs(function () { + navigator.contacts.find(["displayName", "name", "phoneNumbers", "emails"], win, fail, { + multiple: true + }); + }); + + waitsFor(function () { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT); + + runs(function () { + expect(fail).not.toHaveBeenCalled(); + }); + }); it("contacts.spec.4 should throw an exception if success callback is empty", function() { var fail = function() {};
