components#Description TypeScript Examples

The following examples show how to use components#Description. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.test.tsx    From geist-ui with MIT License 6 votes vote down vote up
describe('Description', () => {
  it('should render correctly', () => {
    const wrapper = mount(<Description title="title" />)
    expect(wrapper).toMatchSnapshot()
    expect(() => wrapper.unmount()).not.toThrow()
  })

  it('should render react-node on title', () => {
    let wrapper = mount(<Description title={<p>p</p>} />)
    expect(wrapper.find('p').length).not.toBe(0)

    wrapper = mount(<Description title={<h1>p</h1>} />)
    expect(wrapper.find('h1').length).not.toBe(0)
  })

  it('should render react-node on content', () => {
    let wrapper = mount(<Description content={<p>p</p>} />)
    expect(wrapper.find('p').length).not.toBe(0)

    wrapper = mount(<Description content={<h1>p</h1>} />)
    expect(wrapper.find('h1').length).not.toBe(0)
  })
})