2017-04-17 12:06:56 -04:00
|
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
|
|
|
import { Label } from 'react-bootstrap';
|
|
|
|
|
2018-04-18 00:05:01 -04:00
|
|
|
import CachedLabel from '../../../src/components/CachedLabel';
|
2017-04-17 12:06:56 -04:00
|
|
|
|
|
|
|
describe('CachedLabel', () => {
|
|
|
|
const defaultProps = {
|
|
|
|
onClick: () => {},
|
|
|
|
cachedTimestamp: '2017-01-01',
|
|
|
|
};
|
|
|
|
|
|
|
|
it('is valid', () => {
|
|
|
|
expect(
|
|
|
|
React.isValidElement(<CachedLabel {...defaultProps} />),
|
2018-10-15 16:10:18 -04:00
|
|
|
).toBe(true);
|
2017-04-17 12:06:56 -04:00
|
|
|
});
|
|
|
|
it('renders', () => {
|
|
|
|
const wrapper = shallow(
|
|
|
|
<CachedLabel {...defaultProps} />,
|
|
|
|
);
|
2018-10-15 16:10:18 -04:00
|
|
|
expect(wrapper.find(Label)).toHaveLength(1);
|
2017-04-17 12:06:56 -04:00
|
|
|
});
|
|
|
|
});
|