<commit_before>const React = require('react');
const assertEqualJSX = require('assert-equal-jsx');
const FormFieldError = require('../src/FormFieldError');

describe('FormFieldError', function() {
  it('should render valid state', function() {
    assertEqualJSX(
      <FormFieldError field={{}} validations={{}}></FormFieldError>,
      ''
    );
  });

  it('should render invalid state', function() {
    assertEqualJSX(
      <FormFieldError field={{ invalid: true }} validations={{}}></FormFieldError>,
      // should equal
      <div className="cf-form__field-error"></div>
    );
  });

  it('should render invalid state with validation errors', function() {
    assertEqualJSX(<commit_msg>This test is failing because both parameters are passed to renderToStaticMarkup, this fixes it<commit_after>const React = require('react');
const assertEqualJSX = require('assert-equal-jsx');
const expect = require('chai').expect;
const renderToStaticMarkup = require('react-dom/server').renderToStaticMarkup;
const FormFieldError = require('../src/FormFieldError');

describe('FormFieldError', function() {
  it('should render valid state', function() {
    expect(renderToStaticMarkup(<FormFieldError field={{}} validations={{}}></FormFieldError>)).to.be.equal('');
  });

  it('should render invalid state', function() {
    assertEqualJSX(
      <FormFieldError field={{ invalid: true }} validations={{}}></FormFieldError>,
      // should equal
      <div className="cf-form__field-error"></div>
    );
  });

  it('should render invalid state with validation errors', function() {
    assertEqualJSX(
{'fraction_non_alphanumeric': 0.1576323987538941, 'fraction_numerical': 0.0, 'mean_word_length': 4.818840579710145, 'pattern_counts': {'":': 0, '<': 15, '<?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': '4548576', 'n_tokens_mistral': 446, 'n_tokens_neox': 439, 'n_words': 105}