Skip to content
Permalink
Browse files
Provide a test case for CB-3522 which is broken on WP8
  • Loading branch information
Kevin Boyle authored and purplecabbage committed Jun 10, 2013
1 parent 100b954 commit 579475ee5e9ed7c77890538a8c6bddaa6801face
Showing 1 changed file with 20 additions and 0 deletions.
@@ -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() {};

0 comments on commit 579475e

Please sign in to comment.