From 98522eb10272955dab984fbe0106f151cc6d335d Mon Sep 17 00:00:00 2001 From: thuva4 Date: Wed, 25 Apr 2018 17:11:26 +0530 Subject: Add tests for the toast message in the pods page Change-Id: Iefa52381b775da6f734a41d1ca602f964f93c183 Signed-off-by: thuva4 --- testapi/opnfv_testapi/ui/components/pods/podsController.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'testapi/opnfv_testapi/ui/components/pods') diff --git a/testapi/opnfv_testapi/ui/components/pods/podsController.js b/testapi/opnfv_testapi/ui/components/pods/podsController.js index 3a94338..3b6ab97 100644 --- a/testapi/opnfv_testapi/ui/components/pods/podsController.js +++ b/testapi/opnfv_testapi/ui/components/pods/podsController.js @@ -94,17 +94,17 @@ role: pod.role, details: pod.details }; - ctrl.podsRequest = - $http.post(pods_url, body).success(function (data) { + ctrl.podsRequest = $http.post(pods_url, body) + + ctrl.podsRequest.success(function (data) { ctrl.success = "Create Success" ctrl.toastSuccess() ctrl.listPods(); - return true; }).catch(function (data) { ctrl.error = data.statusText; ctrl.toastError() - return false; }); + return ctrl.podsRequest } else{ ctrl.error = 'Name is missing.' @@ -262,9 +262,9 @@ */ function confirm() { if (angular.isDefined(ctrl.data.successHandler)) { - if(ctrl.data.successHandler(ctrl.pod)){ + ctrl.data.successHandler(ctrl.pod).success( function(data){ $uibModalInstance.close(); - } + }) } } -- cgit 1.2.3-korg