@retailmenot/anchor
Version:
A React UI Library by RetailMeNot
31 lines • 1.33 kB
JavaScript
// REACT
import * as React from 'react';
import * as renderer from 'react-test-renderer';
// VENDOR
import { shallow } from 'enzyme';
// COMPONENT
import { Page } from './Page.component';
describe('Component: Page', () => {
const subject = React.createElement(Page, null);
// const wrapper = mount(subject);
const component = shallow(subject);
it('should be defined.', () => {
expect(subject).toBeDefined();
expect(component).toBeDefined();
const tree = renderer.create(subject).toJSON();
expect(tree).toMatchSnapshot();
});
it('should render with default settings', () => {
expect(component.find('.anchor-page').exists()).toBeTruthy();
});
it('should render with passed props.', () => {
const header = React.createElement("header", null, "Test Header");
const footer = React.createElement("footer", null, "Test Footer");
const footerHeight = '2rem';
const headerHeight = '8rem';
const testSubject = shallow(React.createElement(Page, { headerHeight: headerHeight, footerHeight: footerHeight, header: header, footer: footer }));
expect(testSubject.find('header').exists()).toBeTruthy();
expect(testSubject.find('footer').exists()).toBeTruthy();
});
});
//# sourceMappingURL=Page.component.spec.js.map