import React from 'react';
import { mount } from 'enzyme';

import Formatic from './lib/formatic';

export const renderFieldsToHtml = (fields, handleComponent = () => {}) => {
  const config = Formatic.createConfig();
  const value = config.createRootValue({
    fields,
  });

  const component = mount(
    <Formatic
      config={config}
      value={value}
      fields={fields}
      onChange={() => {}}
    />
  );
  handleComponent(component);
  const html = component.html();
  component.unmount();
  return html;
};

@@ -93,16 +93,167 @@
 atic';%0A%0A
+// Render some Formatic fields to HTML so we can do a snapshot test of them.%0A// Pass in a callback so you can do assertions on the components as well.%0A
 export c

Document function a bit