Repository URL to install this package:
|
Version:
8.0.0-rc.1 ▾
|
import React from 'react';
import { shallow } from 'enzyme';
import Pattern from '../Pattern';
describe('Pattern', () => {
let component;
beforeEach(() => {
component = shallow(
<Pattern>
<div>Some children content</div>
</Pattern>
);
});
it('should match a snapshot', () => {
expect(component.getElement()).toMatchSnapshot();
});
describe('when className is passed', () => {
const className = 'Unicorn';
beforeEach(() => {
component.setProps({ className });
});
it('should match a snapshot', () => {
expect(component.getElement()).toMatchSnapshot();
});
});
describe('when background image is passed', () => {
const backgroundImage = 'yabba dabba doo image';
beforeEach(() => {
component.setProps({ backgroundImage });
});
it('should match a snapshot', () => {
expect(component.getElement()).toMatchSnapshot();
});
describe('when background repeat is passed', () => {
const repeat = true;
beforeEach(() => {
component.setProps({ repeat });
});
it('should match a snapshot', () => {
expect(component.getElement()).toMatchSnapshot();
});
});
describe('when color is passed', () => {
const color = 'red';
beforeEach(() => {
component.setProps({ color });
});
it('should match a snapshot', () => {
expect(component.getElement()).toMatchSnapshot();
});
});
describe('when default color is passed', () => {
const color = Pattern.DEFAULT_COLOR;
beforeEach(() => {
component.setProps({ color });
});
it('should match a snapshot', () => {
expect(component.getElement()).toMatchSnapshot();
});
});
});
});