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    
@doodle/components / src / components / user / HeaderWidget / HeaderWidget.spec.js
Size: Mime:
import React from 'react';
import { mount } from 'enzyme';
import HeaderWidget from './HeaderWidget';
import userData from '../../structure/Navigation/fixture';

describe('HeaderWidget', () => {
  it('should match the snapshot', () => {
    const component = mount(<HeaderWidget />);
    expect(component.getElement()).toMatchSnapshot();
  });

  it('should render a UserMenu if the user is logged in', () => {
    const component = mount(<HeaderWidget user={userData} />);
    expect(component.contains('UserMenu'));
  });

  it('should render a login and signup button if a user is not logged in', () => {
    const component = mount(<HeaderWidget />);
    expect(component.find('.HeaderWidget-loginButton'));
    expect(component.find('.HeaderWidget-signupButton'));
  });

  it('should render a UserMenu with user avatar and name if user is logged in', () => {
    const component = mount(<HeaderWidget user={userData} />);
    expect(component.find('.UserAvatar-avatar'));
    expect(component.find('.UserArea-userName'));
  });
});