{"size": 4724, "ext": "js", "max_stars_repo_path": "cypress/integration/component-accordion.js", "max_stars_repo_name": "daggelito02/vanilla-pattern-library", "max_stars_repo_stars_event_min_datetime": "2019-02-28T13:19:23.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-21T04:30:51.000Z", "max_issues_repo_path": "cypress/integration/component-accordion.js", "max_issues_repo_name": "daggelito02/vanilla-pattern-library", "max_issues_repo_issues_event_min_datetime": "2019-02-22T14:14:46.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-11T10:12:16.000Z", "max_forks_repo_path": "cypress/integration/component-accordion.js", "max_forks_repo_name": "daggelito02/vanilla-pattern-library", "max_forks_repo_forks_event_min_datetime": "2019-03-03T13:12:39.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-12T14:38:49.000Z"}
{"max_stars_count": 8, "max_issues_count": 287, "max_forks_count": 15, "avg_line_length": 23.9796954315, "max_line_length": 80, "alphanum_fraction": 0.5867908552}
const baseUrl = 'http://localhost:9001';
const standalonePath = 'osp/standalone/component';
const suffix = 'preview.html';
const applitoolsConfig = require('../../applitools.config').default;

const component = {
  id: 'component-accordion'
};

describe(`${component.id}`, function() {
  const v = { variant: 'css-interactive', states: 2 };
  const documentationId = `${component.id}-${v.variant}`;
  before(function() {
    cy.eyesOpen({
      ...applitoolsConfig,
      batchName: component.id
    });
  });

  after(function() {
    cy.eyesClose();
  });

  it(`should render all states for ${documentationId}`, () => {
    for (let state = 0; state < v.states; state++) {
      cy.visit(
        `${baseUrl}/${standalonePath}/${documentationId}/${state}/${suffix}`
      );

      cy.eyesCheckWindow(`${documentationId}, state: ${state}`);
    }
  });

  it('should have all sections closed initially for state 0 (radio)', () => {
    cy.visit(`${baseUrl}/${standalonePath}/${documentationId}/0/${suffix}`);
    cy.eyesCheckWindow(`${documentationId} radio, initial`);
  });
});

describe(`${component.id}`, function() {
  const v = { variant: 'css-interactive', states: 2 };
  const documentationId = `${component.id}-${v.variant}`;

  before(function() {
    cy.eyesOpen({
      ...applitoolsConfig,
      batchName: component.id
    });
  });

  after(function() {
    cy.eyesClose();
  });

  it('should open first section when clicked for state 0 (radio)', () => {
    cy.visit(`${baseUrl}/${standalonePath}/${documentationId}/0/${suffix}`);

    cy.get('dt')
      .first()
      .click();

    cy.eyesCheckWindow(`${documentationId} radio, first open`);
  });
});

describe(`${component.id}`, function() {
  const v = { variant: 'css-interactive', states: 2 };
  const documentationId = `${component.id}-${v.variant}`;

  before(function() {
    cy.eyesOpen({
      ...applitoolsConfig,
      batchName: component.id
    });
  });

  after(function() {
    cy.eyesClose();
  });

  it('should open first and then second section for state 0 (radio)', () => {
    cy.visit(`${baseUrl}/${standalonePath}/${documentationId}/0/${suffix}`);

    cy.get('dt')
      .eq(1)
      .click();

    cy.eyesCheckWindow(`${documentationId} radio, second open`);
  });
});

describe(`${component.id}`, function() {
  const v = { variant: 'css-interactive' };
  const documentationId = `${component.id}-${v.variant}`;

  before(function() {
    cy.eyesOpen({
      ...applitoolsConfig,
      batchName: component.id
    });
  });

  after(function() {
    cy.eyesClose();
  });

  it('should open first section when clicked for state 1 (checkbox)', () => {
    cy.visit(`${baseUrl}/${standalonePath}/${documentationId}/1/${suffix}`);

    cy.get('dt')
      .first()
      .click();

    cy.eyesCheckWindow(`${documentationId} checkbox, first open`);
  });
});

describe(`${component.id}`, function() {
  const v = { variant: 'css-interactive' };
  const documentationId = `${component.id}-${v.variant}`;

  before(function() {
    cy.eyesOpen({
      ...applitoolsConfig,
      batchName: component.id
    });
  });

  after(function() {
    cy.eyesClose();
  });

  it('should open first and then second section for state 1 (checkbox)', () => {
    cy.visit(`${baseUrl}/${standalonePath}/${documentationId}/1/${suffix}`);

    cy.get('dt')
      .first()
      .click();

    cy.get('dt')
      .eq(1)
      .click();

    cy.eyesCheckWindow(`${documentationId} checkbox, first and second open`);
  });
});

describe(`${component.id}`, function() {
  const v = { variant: 'static', states: 1 };
  const documentationId = `${component.id}-${v.variant}`;
  before(function() {
    cy.eyesOpen({
      ...applitoolsConfig,
      batchName: component.id
    });
  });

  after(function() {
    cy.eyesClose();
  });

  it(`should render all states for ${documentationId}`, () => {
    for (let state = 0; state < v.states; state++) {
      cy.visit(
        `${baseUrl}/${standalonePath}/${documentationId}/${state}/${suffix}`
      );

      cy.eyesCheckWindow(`${documentationId}, state: ${state}`);
    }
  });
});

describe(`${component.id}`, function() {
  const v = { variant: 'subheadlines', states: 1 };
  const documentationId = `${component.id}-${v.variant}`;
  before(function() {
    cy.eyesOpen({
      ...applitoolsConfig,
      batchName: component.id
    });
  });

  after(function() {
    cy.eyesClose();
  });

  it(`should render all states for ${documentationId}`, () => {
    for (let state = 0; state < v.states; state++) {
      cy.visit(
        `${baseUrl}/${standalonePath}/${documentationId}/${state}/${suffix}`
      );

      cy.eyesCheckWindow(`${documentationId}, state: ${state}`);
    }
  });
});
