You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.4 KiB
45 lines
1.4 KiB
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(<Notification />).toJSON()
|
|
expect(tree).toMatchSnapshot()
|
|
})
|
|
|
|
describe('variant = success', () => {
|
|
it('should render with the success icon', () => {
|
|
const wrapper = shallow(<Notification variant="success" />)
|
|
expect(wrapper.find(Success)).toHaveLength(1)
|
|
})
|
|
})
|
|
|
|
describe('variant = warning', () => {
|
|
it('should render with the warning icon', () => {
|
|
const wrapper = shallow(<Notification variant="warning" />)
|
|
expect(wrapper.find(Warning)).toHaveLength(1)
|
|
})
|
|
})
|
|
|
|
describe('variant = error', () => {
|
|
it('should render with the error icon', () => {
|
|
const wrapper = shallow(<Notification variant="error" />)
|
|
expect(wrapper.find(Error)).toHaveLength(1)
|
|
})
|
|
})
|
|
|
|
describe('processing', () => {
|
|
it('should render with the spinner', () => {
|
|
const wrapper = shallow(<Notification processing />)
|
|
expect(wrapper.find(Spinner)).toHaveLength(1)
|
|
})
|
|
})
|
|
})
|
|
|