<commit_before>var Grid = require('../src/grid.js');


describe('Grid', function() {
  describe('with one stack', function() {
    it('should place all items on same row', function() {
      var grid = new Grid([
        {id: 1, stack: 1},
        {id: 2, stack: 1},
        {id: 3, stack: 1},
        {id: 4, stack: 1}
      ]);

      expect(grid).to.have.positions({
        1: [0, 0, 25, 100],
        2: [25, 0, 25, 100],
        3: [50, 0, 25, 100],
        4: [75, 0, 25, 100],
      });
    });
  });

  it('should place two items on the same row', function() {
    var grid = new Grid([
      {id: 1, stack: 1},
      {id: 2, stack: 2}
    ]);

    expect(grid).to.have.positions({
      1: [0, 0, 50, 100],
      2: [50, 0, 50, 100]
    });
  });

  it('should stretch the items horizontally', function() {
    var grid = new Grid([
      {id: 1, stack: 1},
      {id: 2, stack: 1},
      {id: 3, stack: 2},
      {id: 4, stack: 2},
      {id: 5, stack: 3},
      {id: 6, stack: 3},
    ]);

    expect(grid).to.have.positions({
      1: [0, 0, 50, 33.33],
      2: [50, 0, 50, 33.33],
      3: [0, 33.33, 50, 33.33],
      4: [50, 33.33, 50, 33.33],
      5: [0, 66.66, 50, 33.33],
      6: [50, 66.66, 50, 33.33]
    });
  });

  it('should stretch rows', function() {
    var grid = new Grid([
      {id: 1, stack: 1},
      {id: 2, stack: 2},
      {id: 3, stack: 3},
      {id: 4, stack: 4},
      {id: 5, stack: 5},
      {id: 6, stack: 6}
    ]);

    expect(grid).to.have.positions({
      1: [0, 0, 33.33, 50],
      2: [33.33, 0, 33.33, 50],
      3: [66.66, 0, 33.33, 50],
      4: [0, 50, 33.33, 50],<commit_msg>Update tests.<commit_after>var Grid = require('../src/grid.js');


describe('Grid', function() {
  it('should stretch the stacks horizontally', function() {
    var grid = new Grid([
      {id: 1, stack: 1},
      {id: 2, stack: 1},
      {id: 3, stack: 2},
      {id: 4, stack: 2},
      {id: 5, stack: 3},
      {id: 6, stack: 3},
    ]);

    expect(grid).to.have.positions({
      1: [0, 0, 50, 33.33],
      2: [50, 0, 50, 33.33],
      3: [0, 33.33, 50, 33.33],
      4: [50, 33.33, 50, 33.33],
      5: [0, 66.66, 50, 33.33],
      6: [50, 66.66, 50, 33.33]
    });
  });

  it('should stretch the stacks vertically', function() {
    var grid = new Grid([
      {id: 1, stack: 1},
      {id: 2, stack: 2},
      {id: 3, stack: 3},
      {id: 4, stack: 4},
      {id: 5, stack: 5},
      {id: 6, stack: 6}
    ]);

    expect(grid).to.have.positions({
      1: [0, 0, 33.33, 50],
      2: [33.33, 0, 33.33, 50],
      3: [66.66, 0, 33.33, 50],
      4: [0, 50, 33.33, 50],
{'fraction_non_alphanumeric': 0.22349789513968618, 'fraction_numerical': 0.1285878300803674, 'mean_word_length': 1.8537117903930131, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2799848', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1048, 'n_words': 333}