import React from 'react'
import renderer from 'react-test-renderer'
import { configure, shallow } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import Success from 'components/Icon/Success'
import Warning from 'components/Icon/Warning'
import Error from 'components/Icon/Error'
import { Notification, Spinner } from 'components/UI'
configure({ adapter: new Adapter() })
describe('component.UI.Notification', () => {
it('should render correctly', () => {
const tree = renderer.create().toJSON()
expect(tree).toMatchSnapshot()
})
describe('variant = success', () => {
it('should render with the success icon', () => {
const wrapper = shallow()
expect(wrapper.find(Success)).toHaveLength(1)
})
})
describe('variant = warning', () => {
it('should render with the warning icon', () => {
const wrapper = shallow()
expect(wrapper.find(Warning)).toHaveLength(1)
})
})
describe('variant = error', () => {
it('should render with the error icon', () => {
const wrapper = shallow()
expect(wrapper.find(Error)).toHaveLength(1)
})
})
describe('processing', () => {
it('should render with the spinner', () => {
const wrapper = shallow()
expect(wrapper.find(Spinner)).toHaveLength(1)
})
})
})