Shazron Abdullah created CB-609:
-----------------------------------

             Summary: Contact update test fails when it should pass
                 Key: CB-609
                 URL: https://issues.apache.org/jira/browse/CB-609
             Project: Apache Callback
          Issue Type: Bug
          Components: iOS, mobile-spec
    Affects Versions: 1.7.0
            Reporter: Shazron Abdullah
            Assignee: Shazron Abdullah


This test fails on iOS when it should pass: 
https://github.com/apache/incubator-cordova-mobile-spec/blob/master/autotest/tests/contacts.tests.js#L313

I have verified that the method does return to the save callback (in Obj-C), 
and also created a new project and:
1. created and saved a contact
2. From the contact returned from the save callback of (1), I updated the 
contact and saved again
3. The save callback from the save in (2) was ok

Perhaps this is a timing issue, not sure.

{code}
    var myContact = null;
        function onDeviceReady()
        {
        // create a new contact object
        myContact = navigator.contacts.create();
        myContact.displayName = "Plumber";
        myContact.nickname = "Plumber";       //specify both to support all 
devices
        
        // populate some fields
        var name = new ContactName();
        name.givenName = "Jane";
        name.familyName = "Doe";
        myContact.name = name;
        
        // save to device
        myContact.save(onSuccess,onError);        
        }
        
    function onSuccess(contact) {
        alert("Save Success");
        myContact = contact;
        
        
        myContact.note = "an UPDATED note";
        myContact.save(onSuccess2,onError2);        
    };
    
    function onError(contactError) {
        alert("Error = " + contactError.code);
    };
    
    function onSuccess2(contact) {
        alert("Update Save Success");
    };
    
    function onError2(contactError) {
        alert("Error2 = " + contactError.code);
    };

{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to