diff options
author | thuva4 <tharma.thuva@gmail.com> | 2018-04-25 17:11:26 +0530 |
---|---|---|
committer | thuva4 <tharma.thuva@gmail.com> | 2018-04-25 17:11:26 +0530 |
commit | 98522eb10272955dab984fbe0106f151cc6d335d (patch) | |
tree | 23c7bc269905c0cf360b9258f4a8962828d778bd /testapi/opnfv_testapi/ui/components/pods | |
parent | df935b524b626e2eea0636d953899cd69b03631b (diff) |
Add tests for the toast message in the pods page
Change-Id: Iefa52381b775da6f734a41d1ca602f964f93c183
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/opnfv_testapi/ui/components/pods')
-rw-r--r-- | testapi/opnfv_testapi/ui/components/pods/podsController.js | 12 |
1 files changed, 6 insertions, 6 deletions
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(); - } + }) } } |