{"size": 651, "ext": "js", "max_stars_repo_path": "src/tests/HomePage.test.js", "max_stars_repo_name": "veliancreate/pp-ui", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/tests/HomePage.test.js", "max_issues_repo_name": "veliancreate/pp-ui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/tests/HomePage.test.js", "max_forks_repo_name": "veliancreate/pp-ui", "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": 25.0384615385, "max_line_length": 51, "alphanum_fraction": 0.6175115207}
import React from 'react';
import HomePage from '../HomePage'
import SearchQuestions from '../SearchQuestions'
import { shallow } from 'enzyme'

it('renders questions if authenticated', () => {
  const div = document.createElement('div');
  const auth = {
    isAuthenticated: () => true,
    login: () => {},
  }
  const w = shallow(<HomePage auth={auth} />, div);
  const c = w.find(SearchQuestions)
  expect(c.length).toEqual(1)
})

it('renders login if not', () => {
  const auth = {
    isAuthenticated: () => false,
    login: () => {},
  }
  const w = shallow(<HomePage auth={auth} />)
  const c = w.find('h2')
  expect(c.length).toEqual(1)
})
