# All files / __test__ fixtures.js

100% Statements 15/15
50% Branches 1/2
100% Functions 2/2
100% Lines 15/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
    6212x
    12x

    12x

    52x
    52x

    52x
    52x
    85x

    52x

    52x

    52x

    52x

    53x

    12x

    12x
     const $ = require('jquery'),
      List = require('../src/index');

    var fixture = {
      list: function(valueNames, items) {
        var listHtml = $('<div id="list"><ul class="list"></ul></div>'),
          item = "";

        item = "<li>";
        for (var i = 0; i < valueNames.length; i++) {
          item += '<span class="'+valueNames[i]+'"</span>';
        }
        item += "</li>";

        $(document.body).append(listHtml);

        items = items || [];

        return new List('list', {
          valueNames: valueNames,
          item: item
        }, items);
      },
      removeList: function() {
        $('#list').remove();
      },
      jonny: {
        name: "Jonny Strömberg",
        born: '1986'
      },
      martina: {
        name: "Martina Elm",
        born: '1986'
      },
      angelica: {
        name: "Angelica Abraham",
        born: '1986'
      },
      sebastian: {
        name: "Sebastian Höglund",
        born: '1989'
      },
      imma: {
        name: "Imma Grafström",
        born: '1953'
      },
      hasse: {
        name: "Hasse Strömberg",
        born: '1955'
      }
    };
    fixture.all = [
      fixture.jonny,
      fixture.martina,
      fixture.angelica,
      fixture.sebastian,
      fixture.imma,
      fixture.hasse
    ];

    module.exports = fixture;