{"size": 580, "ext": "js", "max_stars_repo_path": "src/formatter/propNameSorter.spec.js", "max_stars_repo_name": "frytyler/react-element-to-jsx-string", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/formatter/propNameSorter.spec.js", "max_issues_repo_name": "frytyler/react-element-to-jsx-string", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/formatter/propNameSorter.spec.js", "max_forks_repo_name": "frytyler/react-element-to-jsx-string", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.7142857143, "max_line_length": 99, "alphanum_fraction": 0.55}
/* @flow */

import propNameSorter from './propNameSorter';

test('The propNameSorter should always move the `key` and `ref` keys first', () => {
  const fixtures = ['c', 'key', 'a', 'ref', 'b'];

  expect(fixtures.sort(propNameSorter(false))).toEqual([
    'key',
    'ref',
    'c',
    'a',
    'b',
  ]);
});

test('The propNameSorter should always sort the props and keep `key` and `ref` keys first', () => {
  const fixtures = ['c', 'key', 'a', 'ref', 'b'];

  expect(fixtures.sort(propNameSorter(true))).toEqual([
    'key',
    'ref',
    'a',
    'b',
    'c',
  ]);
});
