projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more code tidy ups
[civicrm-core.git]
/
tests
/
qunit
/
crm-api3
/
test.js
diff --git
a/tests/qunit/crm-api3/test.js
b/tests/qunit/crm-api3/test.js
index 51b0154895b3641062f4d43a87ece84c34048ff9..fdf48cd8d2198034b4bc18bc94e8525790bf45e7 100644
(file)
--- a/
tests/qunit/crm-api3/test.js
+++ b/
tests/qunit/crm-api3/test.js
@@
-1,10
+1,9
@@
-
/* ------------ Test cases ------------ */
module('api single');
asyncTest("simple api call", function() {
CRM.api3('contact', 'get').done(function(result) {
/* ------------ Test cases ------------ */
module('api single');
asyncTest("simple api call", function() {
CRM.api3('contact', 'get').done(function(result) {
- equal(result.is_error, 0, 'contact get
failed
');
+ equal(result.is_error, 0, 'contact get');
start();
});
});
start();
});
});
@@
-17,8
+16,8
@@
asyncTest("array api calls", function() {
['phone', 'get', {phone: '123'}]
];
CRM.api3(params).done(function(result) {
['phone', 'get', {phone: '123'}]
];
CRM.api3(params).done(function(result) {
- equal(result[0].is_error, 0, 'email get
failed
');
- equal(result[1].is_error, 0, 'phone get
failed
');
+ equal(result[0].is_error, 0, 'email get');
+ equal(result[1].is_error, 0, 'phone get');
start();
});
});
start();
});
});
@@
-26,11
+25,13
@@
asyncTest("array api calls", function() {
asyncTest("named api calls", function() {
var params = {
one: ['email', 'getoptions', {field: 'location_type_id'}],
asyncTest("named api calls", function() {
var params = {
one: ['email', 'getoptions', {field: 'location_type_id'}],
- two: ['phone', 'get', {field: 'phone_type_id'}]
+ two: ['phone', 'getoptions', {field: 'phone_type_id', sequential: 1}],
+ three: ['phone', 'get']
};
CRM.api3(params).done(function(result) {
};
CRM.api3(params).done(function(result) {
- ok(result.one.count > 0, 'email getoptions failed');
- ok(result.two.count > 0, 'phone getoptions failed');
+ ok(result.one.count > 0, 'email getoptions');
+ ok(result.two.count > 0, 'phone getoptions');
+ ok(result.three.count > 0, 'phone get');
start();
});
});
start();
});
});