X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fqunit%2Fcrm-api3%2Ftest.js;h=fdf48cd8d2198034b4bc18bc94e8525790bf45e7;hb=57507ae66f0dd2212c35b6cbdadd752c9b4c5137;hp=51b0154895b3641062f4d43a87ece84c34048ff9;hpb=cc9b655cc2686260be3931d5b8ceba0df61abe8b;p=civicrm-core.git diff --git a/tests/qunit/crm-api3/test.js b/tests/qunit/crm-api3/test.js index 51b0154895..fdf48cd8d2 100644 --- 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) { - equal(result.is_error, 0, 'contact get failed'); + equal(result.is_error, 0, 'contact get'); start(); }); }); @@ -17,8 +16,8 @@ asyncTest("array api calls", function() { ['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(); }); }); @@ -26,11 +25,13 @@ asyncTest("array api calls", function() { 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) { - 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(); }); });