import * as React from 'react'
import { shallow } from 'enzyme'
import Banner from '..'
describe('packages/ui', () => {
describe('Banner', () => {
it('renders correctly with a selected value', () => {
const element = (
{({ name }) => Test the {name}
}
)
const wrapper = shallow(element)
expect(wrapper).toMatchSnapshot()
})
it('renders without a close button', () => {
const element = (
{({ name }) => Test the {name}
}
)
const wrapper = shallow(element)
expect(wrapper).toMatchSnapshot()
})
it('renders without a class name', () => {
const element = (
{({ name }) => Test the {name}
}
)
const wrapper = shallow(element)
expect(wrapper).toMatchSnapshot()
})
it('reads from state and renders null', () => {
const element = (
{({ name }) => Test the {name}
}
)
const wrapper = shallow(element)
wrapper.setState({ bannerHasBeenClosed: true })
expect(wrapper).toMatchSnapshot()
})
})
})