import { forEach } from 'ramda';

import blocks from '.';
import File from './File';
import Heading from './Heading';
import Image from './Image';
import List from './List';
import Paragraph from './Paragraph';
import Quote from './Quote';

describe('blocks module', () => {
  const testCases = [
    { name: 'storyshare/file', block: File },
    { name: 'storyshare/heading', block: Heading },
    { name: 'storyshare/image', block: Image },
    { name: 'storyshare/list', block: List },
    { name: 'storyshare/paragraph', block: Paragraph },
    { name: 'storyshare/quote', block: Quote },
  ];

  forEach(({ name, block }) => {
    it(`returns the correct block component for the "${name}" name`, () => {
      expect(blocks[name]).toBe(block);
    });
  }, testCases);
});
