{"size": 1156, "ext": "js", "max_stars_repo_path": "tests/ui/user-messages.spec.js", "max_stars_repo_name": "rahman95/react-redux-chat", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tests/ui/user-messages.spec.js", "max_issues_repo_name": "rahman95/react-redux-chat", "max_issues_repo_issues_event_min_datetime": "2022-02-20T20:47:39.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-20T20:47:39.000Z", "max_forks_repo_path": "tests/ui/user-messages.spec.js", "max_forks_repo_name": "rahman95/react-redux-chat", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 27.5238095238, "max_line_length": 94, "alphanum_fraction": 0.5795847751}
describe('User Messages', () => {
  before(() => {
    cy.visitApp();
  });

  it('should be on correct page', () => {
    cy.contains('React Redux Chat').should('exist');
    cy.contains('All Messages').should('exist');
    cy.contains('Loading...').should('exist');
  });

  it('should be able to click on user', () => {
    cy.contains('Amanda Baker').click();
  });

  it('should now see correct title', () => {
    cy.contains('User Messages');
  });

  it('should be able to find correct first and last message', () => {
    cy.findAllByTestId('message').first().within(() => {
      cy.contains('Amanda Baker');
      cy.contains('Mauris lacinia sapien quis libero.');
      cy.contains('27 Feb 2017 13:47');
    });

    cy.findAllByTestId('message').last().within(() => {
      cy.contains('Amanda Baker');
      cy.contains('Nulla tempus. Vivamus in felis eu sapien cursus vestibulum. Proin eu mi.');
      cy.contains('24 Feb 2016 00:01');
    });
  });

  it('should be able to go back to all messages', () => {
    cy.findByRole('button').click();
  });

  it('should now see correct title', () => {
    cy.contains('All Messages');
  });
});
