{"size": 771, "ext": "js", "max_stars_repo_path": "src/plugins/blocksmith/selectors/getBlocksmith.test.js", "max_stars_repo_name": "triniti/cms-js", "max_stars_repo_stars_event_min_datetime": "2019-11-08T21:00:34.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-17T22:35:08.000Z", "max_issues_repo_path": "src/plugins/blocksmith/selectors/getBlocksmith.test.js", "max_issues_repo_name": "triniti/cms-js", "max_issues_repo_issues_event_min_datetime": "2019-10-03T19:26:45.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T23:28:09.000Z", "max_forks_repo_path": "src/plugins/blocksmith/selectors/getBlocksmith.test.js", "max_forks_repo_name": "triniti/cms-js", "max_forks_repo_forks_event_min_datetime": "2020-02-07T17:49:08.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-07T17:49:08.000Z"}
{"max_stars_count": 4, "max_issues_count": 133, "max_forks_count": 1, "avg_line_length": 25.7, "max_line_length": 103, "alphanum_fraction": 0.691309987}
import test from 'tape';
import deepFreeze from 'deep-freeze';
import getBlocksmith from './getBlocksmith';

test('Blocksmith:selector:getBlocksmith', (t) => {
  const initState = {
    blocksmith: {},
  };
  const id = '18ad9d49-de88-4821-85e7-e8c038c5abea';
  const editorState = 'thylacine';

  const testState1 = {
    blocksmith: {
      [id]: editorState,
    },
  };

  deepFreeze(initState);
  let actual = getBlocksmith(initState, id);
  let expected = null;
  t.deepEqual(actual, expected, 'it should return null if there is no EditorState for the article id');

  deepFreeze(testState1);
  actual = getBlocksmith(testState1, id);
  expected = editorState;
  t.deepEqual(actual, expected, 'it should return the EditorState for the article id');

  t.end();
});
