Code coverage report for src\components\factory\eventFactory.js

# all files / src/components/factory/ eventFactory.js

40% Statements 6/15
100% Branches 0/0
25% Functions 1/4
40% Lines 6/15

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    461×
    1×

    1×

    1×

    1×

    1×

     (function component(ng) {
      ng.module('components').factory('eventFactory', eventFactory);

      eventFactory.$inject = ['voyagerFactory'];

      function eventFactory(voyagerFactory) {
        var voyage;

        return {
            init: init
        }

        function init() {
            var vm = this;

            vm.voyage = [
                {
                    object: 'Voyage',
                    number: '124462',
                    doc_number: 42154151551,
                    actual_date: null
                },
                {
                    object: 'Voyage',
                    number: '124462',
                    doc_number: 1221541124214,
                    actual_date: null
                }
            ]

            vm.old_voyage = JSON.parse(JSON.stringify(vm.voyage));

            vm.cancel = cancel;

            voyagerFactory.registrCancelEvent(vm.cancel);

            function cancel() {
                console.log('cancel()');

                vm.voyage = JSON.parse(JSON.stringify(vm.old_voyage));
            }
        }

      }
    })(angular);