You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by alsorokin <gi...@git.apache.org> on 2015/12/09 17:59:58 UTC
[GitHub] cordova-plugin-contacts pull request: CB-10117 Added new tests
GitHub user alsorokin opened a pull request:
https://github.com/apache/cordova-plugin-contacts/pull/99
CB-10117 Added new tests
https://issues.apache.org/jira/browse/CB-10117
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/MSOpenTech/cordova-plugin-contacts CB-10117
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-plugin-contacts/pull/99.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #99
----
commit 210efdca27072548f7aee3ff6244fb527539b14b
Author: Alexander Sorokin <al...@akvelon.com>
Date: 2015-12-02T16:51:50Z
CB-10117 Added new tests
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-contacts pull request: CB-10117 Added new tests
Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-plugin-contacts/pull/99#discussion_r47645743
--- Diff: tests/tests.js ---
@@ -618,20 +720,86 @@ exports.defineManualTests = function(contentEl, createActionButton) {
}
});
} catch (e) {
- alert(e);
+ console.error(e.message);
}
}
- function removeDooneyEvans() {
+ function addDooneyEvans() {
+ var displayName = "Dooney Evans";
+ var contactName = {
+ formatted: "Dooney Evans",
+ familyName: "Evans",
+ givenName: "Dooney",
+ middleName: ""
+ };
+ var phoneNumber = '512-555-1234';
+ var birthday = new Date(1985, 0, 23);
+
+ addContact(displayName, contactName, phoneNumber, birthday);
+ }
+
+ function addNamelessContact() {
+ addContact();
+ }
+
+ function addUnicodeContact() {
+ var displayName = "Н€йромонах \nФеофаЊ";
+ var contactName = {
+ formatted: "Н€йромонах \nФеофаЊ",
+ familyName: "\nФеофаЊ",
+ givenName: "Н€йромонах",
+ middleName: ""
+ };
+
+ addContact(displayName, contactName);
+ }
+
+ function renameDooneyEvans() {
var results = document.getElementById('contact_results');
+ var obj = new ContactFindOptions();
+ obj.filter = 'Dooney Evans';
+ obj.multiple = false;
- navigator.contacts.find(["displayName", "name", "phoneNumbers", "emails", "urls", "note"], function(contacts) {
+ navigator.contacts.find(['displayName', 'name'], function(contacts) {
+ if (contacts.length == 0) {
+ results.innerHTML = 'No contacts to update.';
+ return;
+ }
+ var contact = contacts[0];
+ contact.displayName = "Urist McContact";
+ var name = new ContactName();
+ name.givenName = "Urist";
+ name.familyName = "McContact";
+ contact.name = name;
+ contact.save(function(updated) {
+ results.innerHTML = 'Contact updated.';
+ },function(e) {
+ results.innerHTML = 'Update failed: error ' + e.code;
+ });
+ }, function(e) {
+ if (e.code === ContactError.NOT_SUPPORTED_ERROR) {
+ results.innerHTML = 'Searching for contacts is not supported.';
+ } else {
+ results.innerHTML = 'Search failed: error ' + e.code;
+ }
+ }, obj)
+ }
+
+ function removeTestContacts() {
--- End diff --
Is it possible to reuse `removeContactsByFields` here?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-contacts pull request: CB-10117 Added new tests
Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:
https://github.com/apache/cordova-plugin-contacts/pull/99#issuecomment-164790750
LGTM
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-contacts pull request: CB-10117 Added new tests
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/cordova-plugin-contacts/pull/99
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org