$scope.click = function () { $scope.work.Id = $scope.workid; $scope.work.I_Project = $scope.projectid; if ($scope.work.I_Type == 14) { $scope.work.I_FlowType = 85; } else if ($scope.work.I_Type >= 15 && $scope.work.I_Type <= 21) { $scope.work.I_FlowType = 89; } else { $scope.work.I_FlowType = 88; } return $http.post('/Services/WorkListWebForm.aspx/WorkInsert', { entity: $scope.work }).success(function (data) { if (data != "" && data.d != "") { dialog.info("工单已创建,未出部门,请提交!"); //if ($scope.work.Id < 0) { $http.post('/Services/WorkListWebForm.aspx/GetNewWork', null).success(function (data) { if (data.d) { var param = { Id: data.d.Id, Type: 6, projectId: $scope.work.I_Project }; $state.go("fileUpload", param); } }); //} } }).error(function () { $scope.list = ""; }); }
现在要测试这一段代码 这个方法的http请求后判断直接就跳转了 这种方法 在测试js中怎么写?判断什么东西来验证是否测试通过???