Code coverage report for src\components\header-voyager\voyage-factory.js

# all files / src/components/header-voyager/ voyage-factory.js

69.23% Statements 18/26
100% Branches 0/0
50% Functions 4/8
69.23% Lines 18/26

    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
    46
    47
    48
    49
    50
    51
    521×
    1×

    1×

    1×
    3×
    3×
    3×

    3×

    1×

    1×

    1×
    3×
    3×

    1×

    1×
    3×
    3×

    1×

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

      voyagerFactory.$inject = [];

      function voyagerFactory() {
        var voyager = {};
        var cancel;
        var save;

        return {
            get: get,
            registr: reg,
            registrCancel: regCancel,
            registrSave: regSave,
            getCancel: getCancel,
            getSave: getSave
        };

        function reg(voyager) {
            console.log('registr voyage');
            this.voyager = voyager;
        }

        function get() {
            console.log('get voyage id: ' + this.voyager.voyage_id);
            return this.voyager;
        }

        function regCancel(cancel) {
            console.log('regCancel()');
            this.cancel = cancel;
        }

        function getCancel() {
            console.log('getCancel()');
            this.cancel();
        }

        function regSave(save) {
            console.log('regSave()');
            this.save = save;
        }

        function getSave() {
            console.log('getSave()');
            this.save();
        }

      }
    })(angular);