{"size": 820, "ext": "js", "max_stars_repo_path": "recipes/react-html5-input/cypress/integration/input.spec.js", "max_stars_repo_name": "Mcgurk-Adam/cypress-file-upload", "max_stars_repo_stars_event_min_datetime": "2019-01-31T01:45:46.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-22T02:34:51.000Z", "max_issues_repo_path": "recipes/react-html5-input/cypress/integration/input.spec.js", "max_issues_repo_name": "Mcgurk-Adam/cypress-file-upload", "max_issues_repo_issues_event_min_datetime": "2019-02-10T07:58:55.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-03T07:12:02.000Z", "max_forks_repo_path": "recipes/react-html5-input/cypress/integration/input.spec.js", "max_forks_repo_name": "Mcgurk-Adam/cypress-file-upload", "max_forks_repo_forks_event_min_datetime": "2019-02-05T18:58:28.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-01T15:08:03.000Z"}
{"max_stars_count": 479, "max_issues_count": 235, "max_forks_count": 97, "avg_line_length": 27.3333333333, "max_line_length": 75, "alphanum_fraction": 0.4865853659}
describe('Attach file to an input element', () => {
  beforeEach(() => {
    cy.visit('/');
  });

  [
    { type: 'regular', testId: 'input' },
    { type: 'hidden', testId: 'hidden-input' },
  ].forEach(({ type, testId }) => {
    describe(`${type} input`, () => {
      it('receives a single file', () => {
        cy.get(`[data-cy="${testId}"]`).attachFile('cy.png');

        cy.get(`li.${type}`).should('have.length', 1);

        cy.get(`li.${type}`).contains('cy.png');
      });

      it('receives multiple files (using array of fixtures)', () => {
        cy.get(`[data-cy="${testId}"]`).attachFile(['cy.png', 'test.svg']);

        cy.get(`li.${type}`).should('have.length', 2);

        cy.get(`li.${type}`).contains('cy.png');
        cy.get(`li.${type}`).contains('test.svg');
      });
    });
  });
});
