Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import React from 'react';
import { shallow } from 'enzyme';
import Footer from '../Footer';

describe('Footer', () => {
  it('matches a snapshot', () => {
    const links = [
      { label: 'Test1', to: 'https://www.doodle.com' },
      { label: 'Test2', to: 'https://www.doodle.com/create' },
    ];
    const component = shallow(
      <Footer className="Test" links={links} right={<a href="https://www.doodle.com">Click</a>}>
        <h1>Hello World!</h1>
      </Footer>
    );
    expect(component.getElement()).toMatchSnapshot();
  });

  it('should concatenate the passed className with "Footer ", when passed', () => {
    const className = 'Base';
    const component = shallow(<Footer className={className} />);

    expect(component.props().className).toBe('Footer Base');
  });

  it('should render the right component inside the right section', () => {
    const component = shallow(<Footer right={<span id="right-component" />} />);

    expect(component.find('.Footer-section--right #right-component').exists()).toBeTruthy();
  });
});