Code coverage report for src\components\sop-list\sop-list.js

# all files / src/components/sop-list/ sop-list.js

33.33% Statements 5/15
100% Branches 0/0
33.33% Functions 1/3
33.33% Lines 5/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
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    711×

    1×

    1×

    1×

    1×

     (function component(ng) {

      sopListCtrl.$inject = ['voyage', 'dateFactory'];

      ng.module('components')
        .component('sop', {
          templateUrl: './components/sop-list/sop-list.html',
          controller: sopListCtrl,
          controllerAs: 'vm',
          bindings: {
            sopList: '@'
          }
        });

      function sopListCtrl(voyage, dateFactory) {
        var vm = this;

        vm.sopList = [
            {
                name: 'Test Sop 1',
                description: 'JPG',
                file: {
                    name: 'ewgwsbgewse.jpg',
                    size: '25.234 KB(s)'
                },
                dateCreated: 211523561631,
                dateModified: 32452683483,
                author: 'portal author'
            },
            {
                name: 'Test Sop 2',
                description: 'Doc',
                file: {
                    name: 'ekgksdevg.doc',
                    size: '123.234 MB(s)'
                },
                dateCreated: 23985679236596,
                dateModified: 2142142142142,
                author: 'portal author'
            },
            {
                name: 'Test Sop 3',
                description: 'JPG',
                file: {
                    name: '43greg.jpg',
                    size: '244.23 KB(s)'
                },
                dateCreated: 322234254235,
                dateModified: 125235235325,
                author: 'portal author'
            }
        ];

        vm.getDate = dateFactory.getDate;

        vm.init = init;

        vm.init();

        function init() {
          var s = ' ';
          var length = Object.keys(vm.sopList).length;

          for (var i = 0; i < 15 - length; i++){
            vm.sopList.push(s);
            s += ' ';
          };
        }
      }

    })(angular);