-
Notifications
You must be signed in to change notification settings - Fork 12.9k
/
AlertsWrapper_spec.jsx
31 lines (26 loc) · 1017 Bytes
/
AlertsWrapper_spec.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React from 'react';
import { describe, it } from 'mocha';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import AlertContainer from 'react-alert';
import AlertsWrapper from '../../../javascripts/components/AlertsWrapper';
describe('AlertsWrapper', () => {
let wrapper;
beforeEach(() => {
wrapper = shallow(<AlertsWrapper />);
});
it('is valid', () => {
expect(React.isValidElement(<AlertsWrapper />)).to.equal(true);
});
it('renders AlertContainer', () => {
expect(wrapper.find(AlertContainer)).to.have.length(1);
});
it('expects AlertContainer to have correct props', () => {
const alertContainerProps = wrapper.find(AlertContainer).props();
expect(alertContainerProps.offset).to.be.equal(14);
expect(alertContainerProps.position).to.be.equal('top right');
expect(alertContainerProps.theme).to.be.equal('dark');
expect(alertContainerProps.time).to.be.equal(5000);
expect(alertContainerProps.transition).to.be.equal('fade');
});
});