import React from 'react'
import { mount } from '../../../test/utils'

import { CardHeader } from '../CardHeader'

import { Heading } from '../../../Heading/Heading'

describe('<CardHeader />', () => {
  it('has a header tag when the title is a string', () => {
    const title = 'Palenca'
    const card = mount(<CardHeader title={title} />)
    expect(card.find(Heading)).toContainReactText(title)
  })

  it('has a description when the description is a string', () => {
    const title = 'Palenca'
    const description = 'Lorem ipsum'
    const card = mount(<CardHeader title={title} description={description} />)
    expect(card.find('p')).toContainReactText(description)
  })
})
