{"size": 1230, "ext": "js", "max_stars_repo_path": "index.test.js", "max_stars_repo_name": "mateoholman/react-welcome-user", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "index.test.js", "max_issues_repo_name": "mateoholman/react-welcome-user", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "index.test.js", "max_forks_repo_name": "mateoholman/react-welcome-user", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.0, "max_line_length": 84, "alphanum_fraction": 0.5674796748}
import React from 'react';
import { shallow, render } from 'enzyme';
import Welcome from './src/index';
import WelcomeDist from './dist/index';

describe('Welcome', () => {
  describe('when rendered', () => {
    it('should not throw an error', () => {
      const wrapper = shallow(<Welcome />);
      expect(wrapper.length).toBe(1);
    });

    it('should render "Welcome User!" when no props are passed', () => {
      expect(render(<Welcome />).text()).toBe('Welcome User!');
    });

    it('should render "Welcome Matt!" when "Matt" is passed as a user prop', () => {
      expect(render(<Welcome user={'Matt'} />).text()).toBe('Welcome Matt!');
    });
  });
});

describe('WelcomeDist', () => {
  describe('when rendered', () => {
    it('should not throw an error', () => {
      const wrapper = shallow(<WelcomeDist />);
      expect(wrapper.length).toBe(1);
    });

    it('should render "Welcome User!" when no props are passed', () => {
      expect(render(<WelcomeDist />).text()).toBe('Welcome User!');
    });

    it('should render "Welcome Matt!" when "Matt" is passed as a user prop', () => {
      expect(render(<WelcomeDist user={'Matt'} />).text()).toBe(
        'Welcome Matt!'
      );
    });
  });
});
