Stryker

ServerStartedNotificationController.js - Stryker report

Summary

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

Code

angular.module('juiceShop').controller('ServerStartedNotificationController', 0[
  '$scope',
  '$translate',
  '$cookies',
  'ChallengeService',
  'socket',
  function ($scope, $translate, $cookies, challengeService, socket) 1{
    'use strict'

    $scope.hackingProgress = { }

    $scope.closeNotification = function () 2{
      $scope.hackingProgress.autoRestoreMessage = null
    }

    $scope.clearProgress = function () 3{
      $cookies.remove('continueCode')
      $scope.hackingProgress.cleared = 4true
    }

    socket.on('server started', function () 5{
      var continueCode = $cookies.get('continueCode')
      if (67continueCode) 8{
        challengeService.restoreProgress(encodeURIComponent(continueCode)).then(function () 9{
          $translate('AUTO_RESTORED_PROGRESS').then(function (notificationServerStarted) 10{
            $scope.hackingProgress.autoRestoreMessage = notificationServerStarted
          }, function (translationId) 11{
            $scope.hackingProgress.autoRestoreMessage = translationId
          })
        }).catch(function (error) 12{
          console.log(error)
          $translate('AUTO_RESTORE_PROGRESS_FAILED', { error: error }).then(function (notificationServerStarted) 13{
            $scope.hackingProgress.autoRestoreMessage = notificationServerStarted
          }, function (translationId) 14{
            $scope.hackingProgress.autoRestoreMessage = translationId
          })
        })
      }
    })
  } ])