{"size": 1034, "ext": "js", "max_stars_repo_path": "src/__tests__/containers/SessionDetail-test.js", "max_stars_repo_name": "ferbaco86/study-time-track-frontend", "max_stars_repo_stars_event_min_datetime": "2021-04-12T23:29:06.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-23T02:30:22.000Z", "max_issues_repo_path": "src/__tests__/containers/SessionDetail-test.js", "max_issues_repo_name": "ferbaco86/study-time-track-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/__tests__/containers/SessionDetail-test.js", "max_forks_repo_name": "ferbaco86/study-time-track-frontend", "max_forks_repo_forks_event_min_datetime": "2021-04-03T21:16:12.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-03T21:16:12.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 26.5128205128, "max_line_length": 61, "alphanum_fraction": 0.5686653772}
import {
  render, screen, act, waitFor,
} from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import renderer from 'react-test-renderer';
import store from '../../reducers/store';
import SessionDetail from '../../containers/SessionDetail';

describe('Rendering component', () => {
  it('creates a SessionDetail component', async () => {
    act(() => {
      render(
        <BrowserRouter>
          <Provider store={store}>
            <SessionDetail match={{ params: { id: '2' } }} />
          </Provider>
        </BrowserRouter>,
      );
    });
    await waitFor(() => {
      expect(screen.getByText('LOADING'));
    });
  });
});

describe('SessionDetail', () => {
  it('renders correctly', () => {
    const snap = renderer.create(
      <BrowserRouter>
        <Provider store={store}>
          <SessionDetail match={{ params: { id: '2' } }} />
        </Provider>
      </BrowserRouter>,
    ).toJSON();
    expect(snap).toMatchSnapshot();
  });
});
