<commit_before>import * as assert from 'power-assert';
import beater from 'beater';

import { newEntryViewer } from './helpers';
import { focusNext } from '../../../src/model/entry-viewer';

const { test } = beater();

test('model > entry-viewer > focusNext', () => {
  const data = newEntryViewer();

  const next1 = focusNext(data);
  assert(next1.filteredEntries.length === 10);
  assert(next1.filteredEntries[0].id === '2016-01-31');
  assert(next1.focusedEntryId === '2016-01-30');
  assert(next1.selectedEntry === null);
  assert(next1.selectedEntryId === null);

  const next10 = new Array(10).fill(0).reduce((e, _) => e.focusNext(), data);
  assert(next10.filteredEntries.length === 10);
  assert(next10.filteredEntries[0].id === '2016-01-30');
  assert(next10.focusedEntryId === '2016-01-21');
  assert(next10.selectedEntry === null);
  assert(next10.selectedEntryId === null);

  const next30 = new Array(30).fill(0).reduce((e, _) => e.focusNext(), data);
  assert(next30.filteredEntries.length === 10);
  assert(next30.filteredEntries[0].id === '2016-01-10');
  assert(next30.focusedEntryId === '2016-01-01');
  assert(next30.selectedEntry === null);
  assert(next30.selectedEntryId === null);

  const next31 = new Array(31).fill(0).reduce((e, _) => e.focusNext(), data);
  assert(next31.filteredEntries.length === 10);
  assert(next31.filteredEntries[0].id === '2016-01-10');
  assert(next31.focusedEntryId === '2016-01-01');
  assert(next31.selectedEntry === null);
  assert(next31.selectedEntryId === null);
});<commit_msg>fix a test<commit_after>import * as assert from 'power-assert';
import beater from 'beater';

import { newEntryViewer } from './helpers';
import { focusNext } from '../../../src/model/entry-viewer';

const { test } = beater();

test('model > entry-viewer > focusNext', () => {
  const data = newEntryViewer();

  const next1 = focusNext(data);
  assert(next1.filteredEntries.length === 10);
  assert(next1.filteredEntries[0].id === '2016-01-31');
  assert(next1.focusedEntryId === '2016-01-30');
  assert(next1.selectedEntry === null);
  assert(next1.selectedEntryId === null);

  const next10 = new Array(10).fill(0).reduce((e, _) => focusNext(e), data);
  assert(next10.filteredEntries.length === 10);
  assert(next10.filteredEntries[0].id === '2016-01-30');
  assert(next10.focusedEntryId === '2016-01-21');
  assert(next10.selectedEntry === null);
  assert(next10.selectedEntryId === null);

  const next30 = new Array(30).fill(0).reduce((e, _) => focusNext(e), data);
  assert(next30.filteredEntries.length === 10);
  assert(next30.filteredEntries[0].id === '2016-01-10');
  assert(next30.focusedEntryId === '2016-01-01');
  assert(next30.selectedEntry === null);
  assert(next30.selectedEntryId === null);

  const next31 = new Array(31).fill(0).reduce((e, _) => focusNext(e), data);
  assert(next31.filteredEntries.length === 10);
  assert(next31.filteredEntries[0].id === '2016-01-10');
  assert(next31.focusedEntryId === '2016-01-01');
  assert(next31.selectedEntry === null);
  assert(next31.selectedEntryId === null);
});
{'fraction_non_alphanumeric': 0.2003257328990228, 'fraction_numerical': 0.08273615635179153, 'mean_word_length': 4.974708171206226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '959522', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1020, 'n_words': 176}