2016-09-20 16:45:27 -04:00
|
|
|
import React from 'react';
|
2018-07-12 14:50:25 -04:00
|
|
|
import configureStore from 'redux-mock-store';
|
2016-09-20 16:45:27 -04:00
|
|
|
import { expect } from 'chai';
|
2017-08-10 20:04:44 -04:00
|
|
|
import { shallow } from 'enzyme';
|
2016-09-20 16:45:27 -04:00
|
|
|
|
2017-08-10 20:04:44 -04:00
|
|
|
import { OverlayTrigger } from 'react-bootstrap';
|
2018-06-02 14:08:43 -04:00
|
|
|
import URLShortLinkButton from '../../../src/components/URLShortLinkButton';
|
2016-09-20 16:45:27 -04:00
|
|
|
|
|
|
|
describe('URLShortLinkButton', () => {
|
|
|
|
const defaultProps = {
|
2018-06-02 14:08:43 -04:00
|
|
|
url: 'mockURL',
|
|
|
|
emailSubject: 'Mock Subject',
|
|
|
|
emailContent: 'mock content',
|
2016-09-20 16:45:27 -04:00
|
|
|
};
|
|
|
|
|
2018-07-12 14:50:25 -04:00
|
|
|
function setup() {
|
|
|
|
const mockStore = configureStore([]);
|
|
|
|
const store = mockStore({});
|
|
|
|
return shallow(<URLShortLinkButton {...defaultProps} />, { context: { store } }).dive();
|
|
|
|
}
|
|
|
|
|
2017-08-10 20:04:44 -04:00
|
|
|
it('renders OverlayTrigger', () => {
|
2018-07-12 14:50:25 -04:00
|
|
|
const wrapper = setup();
|
2017-08-10 20:04:44 -04:00
|
|
|
expect(wrapper.find(OverlayTrigger)).have.length(1);
|
|
|
|
});
|
2016-09-20 16:45:27 -04:00
|
|
|
});
|