import React from 'react'
import { Modal, ModalHeader, ModalContent, ModalFooter } from 'stardust'

describe('Modal', () => {
  it('should default ref to be "modal"', () => {
    Modal.defaultProps.ref.should.equal('modal')
  })
  it('should initially have a state where `isShown` is false', () => {
    render(<Modal />).first().state.isShown.should.equal(false)
  })
  it('should render children', () => {
    render(<Modal>Hello</Modal>).assertText('Hello')
  })
  it('sets isShown true', () => {
    const modal = render(<Modal />).first()
    modal.showModal()
    modal.state.isShown.should.equal(true)
  })
  it('sets isShown false', () => {
    const modal = render(<Modal />).first()
    modal.hideModal()
    modal.state.isShown.should.equal(false)
  })
  describe('ModalHeader', () => {
    it('should render children', () => {
      render(<ModalHeader>Hello</ModalHeader>).assertText('Hello')
    })
  })
  describe('ModalContent', () => {
    it('should render children', () => {
      render(<ModalContent>Hello</ModalContent>).assertText('Hello')
    })
  })
  describe('ModalFooter', () => {
    it('should render children', () => {
      render(<ModalFooter>Hey You</ModalFooter>).assertText('Hey You')
    })
  })
})

@@ -37,48 +37,8 @@
 odal
-, ModalHeader, ModalContent, ModalFooter
  %7D f
@@ -807,24 +807,25 @@
 ender(%3CModal
+.
 Header%3EHello
@@ -827,24 +827,25 @@
 Hello%3C/Modal
+.
 Header%3E).ass
@@ -964,24 +964,25 @@
 ender(%3CModal
+.
 Content%3EHell
@@ -985,24 +985,25 @@
 Hello%3C/Modal
+.
 Content%3E).as
@@ -1122,24 +1122,25 @@
 ender(%3CModal
+.
 Footer%3EHey Y
@@ -1144,24 +1144,25 @@
 y You%3C/Modal
+.
 Footer%3E).ass

update deprecated usage