Stryker

ChangePasswordController.js - Stryker report

Summary

File
Mutation score
# Killed
# Survived
# Timeout
# No coverage
# Errors
Total detected
Total undetected
Total mutants
ChangePasswordController.js
100%
6/6 6 0 0 0 0 6 0 6

Code

angular.module('juiceShop').controller('ChangePasswordController', 0[
  '$scope',
  '$location',
  'UserService',
  function ($scope, $location, userService) 1{
    'use strict'

    $scope.changePassword = function () 2{
      userService.changePassword({current: $scope.currentPassword, new: $scope.newPassword, repeat: $scope.newPasswordRepeat}).then(function () 3{
        $scope.error = undefined
        $scope.confirmation = 'Your password was successfully changed.'
        resetForm()
      }).catch(function (error) 4{
        $scope.error = error
        $scope.confirmation = undefined
        resetForm()
      })
    }

    function resetForm () 5{
      $scope.currentPassword = undefined
      $scope.newPassword = undefined
      $scope.newPasswordRepeat = undefined
      $scope.form.$setPristine()
    }
  }])