From 4fb52371f27f4013a8e30c09ccaed75da5a08404 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka Date: Wed, 21 Jun 2017 13:05:15 +0200 Subject: [PATCH] Fixes for ipa_test.js Basically add API version into the API request. The API version was not required before. https://pagure.io/freeipa/issue/6974 Reviewed-By: Petr Vobornik --- install/ui/test/ipa_tests.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/install/ui/test/ipa_tests.js b/install/ui/test/ipa_tests.js index e3bb65eb8..88af29628 100644 --- a/install/ui/test/ipa_tests.js +++ b/install/ui/test/ipa_tests.js @@ -79,7 +79,7 @@ test("Testing IPA.get_entity_param().", function() { test("Testing IPA.get_member_attribute().", function() { equals( - IPA.get_member_attribute("user", "group"), "memberof", + IPA.get_member_attribute("user", "group"), "memberofindirect", "IPA.get_member_attribute(\"user\", \"group\")"); equals( @@ -119,7 +119,9 @@ test("Testing successful rpc.command().", function() { var orig = $.ajax; - var xhr = {}; + // Result needs to be there as it is place where message from API call is + // stored + var xhr = {"result": {}}; var text_status = null; var error_thrown = {name:'ERROR', message:'An error has occurred'}; @@ -138,6 +140,9 @@ test("Testing successful rpc.command().", function() { data.method, object+'_'+method, "Checking method"); + // By default all rpc calls contain version of API + $.extend(options, {'version': window.ipa_loader.api_version}); + same( data.params, [args, options], "Checking parameters"); @@ -212,8 +217,14 @@ test("Testing unsuccessful rpc.command().", function() { equals(data.method, object+'_'+method, "Checking method"); + // By default all rpc calls contain version of API + $.extend(options, { 'version': window.ipa_loader.api_version}); + same(data.params, [args, options], "Checking parameters"); + // remove api version from options object + delete options.version; + request.error(xhr, text_status, error_thrown); }; @@ -313,4 +324,4 @@ test("Testing observer.", function() { obj.event.notify([param1_value, param2_value], obj); }); -};}); \ No newline at end of file +};});