<commit_before>import React from 'react';
import { createShallow } from 'material-ui/test-utils';

import Typography from 'material-ui/Typography';
import TextField from 'material-ui/TextField';
import Button from 'material-ui/Button';

import EntryEditor from './EntryEditor.js';

const setup = propOverrides => {
  const props = Object.assign({
    date: '2018-01-01',
    qualityRatings: ['Good', 'OK', 'Bad'],
    handleCancel: jest.fn(),
    handleSave: jest.fn()
  }, propOverrides);

  let shallow = createShallow({untilSelector: EntryEditor});
  const wrapper = shallow(<EntryEditor {...props} />);

  return wrapper;
}

const POSTprops = {categories: [{pk: 1, category: 'cat'}]};
const PATCHprops = {category: 'cat', url: 'path/to/stuff', rating: 'OK', entry: 'my entry'};

it('renders POST without crashing', () => {
  setup(POSTprops);
});

it('renders PATCH without crashing', () => {
  setup(PATCHprops);
});

it('displays a category if PATCH', () => {
  const wrapper = setup(PATCHprops);
  let text = wrapper.find(Typography).at(1);<commit_msg>Revert "fixed EntryEditor unit tests"<commit_after>import React from 'react';
import { shallow } from 'enzyme';

import Typography from 'material-ui/Typography';
import TextField from 'material-ui/TextField';
import Button from 'material-ui/Button';

import EntryEditor from './EntryEditor.js';

const setup = propOverrides => {
  const props = Object.assign({
    date: '2018-01-01',
    qualityRatings: ['Good', 'OK', 'Bad'],
    handleCancel: jest.fn(),
    handleSave: jest.fn()
  }, propOverrides);

  const wrapper = shallow(<EntryEditor {...props} />);

  return wrapper;
}

const POSTprops = {categories: [{pk: 1, category: 'cat'}]};
const PATCHprops = {category: 'cat', url: 'path/to/stuff', rating: 'OK', entry: 'my entry'};

it('renders POST without crashing', () => {
  setup(POSTprops);
});

it('renders PATCH without crashing', () => {
  setup(PATCHprops);
});

it('displays a category if PATCH', () => {
  const wrapper = setup(PATCHprops);
  let text = wrapper.find(Typography).at(1);
{'fraction_non_alphanumeric': 0.17192812044681885, 'fraction_numerical': 0.009713453132588635, 'mean_word_length': 4.706371191135734, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '3868275', 'n_tokens_mistral': 678, 'n_tokens_neox': 648, 'n_words': 179}