import * as React from 'react'; import { mount } from 'enzyme'; import { description as descriptionView } from './description'; import { description } from '../'; import Markdown from '../../Markdown'; const createDescription = text => mount(descriptionView(description({ text }))); describe('Section: description', () => { describe('given string in `text`', () => { it('should render as markdown', () => { const source = '# hello'; const wrapper = createDescription(source); expect(wrapper.find(Markdown).prop('source')).toEqual(source); }); }); describe('given component in `text`', () => { it('should render that component', () => { const component = ({ number }) =>