Update qUnit api3 test
authorColeman Watts <coleman@civicrm.org>
Sat, 26 Apr 2014 15:44:57 +0000 (08:44 -0700)
committerColeman Watts <coleman@civicrm.org>
Sat, 26 Apr 2014 15:44:57 +0000 (08:44 -0700)
tests/qunit/crm-api3/test.js

index 51b0154895b3641062f4d43a87ece84c34048ff9..35cd165f345950822e9ca03db96cd43314871c4b 100644 (file)
@@ -4,7 +4,7 @@ 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 +17,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 +26,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();
   });
 });