{"size": 1178, "ext": "js", "max_stars_repo_path": "packages/gallery/tests/styleParams/allowHover.spec.js", "max_stars_repo_name": "bchmn/pro-gallery", "max_stars_repo_stars_event_min_datetime": "2020-04-15T08:49:06.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-15T08:49:06.000Z", "max_issues_repo_path": "packages/gallery/tests/styleParams/allowHover.spec.js", "max_issues_repo_name": "bchmn/pro-gallery", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/gallery/tests/styleParams/allowHover.spec.js", "max_forks_repo_name": "bchmn/pro-gallery", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.7317073171, "max_line_length": 74, "alphanum_fraction": 0.6519524618}
import GalleryDriver from '../drivers/reactDriver'
import { expect } from 'chai';
import { images2 } from '../drivers/mocks/items';
import { styleParams, container } from '../drivers/mocks/styles'

describe('styleParam - allowHover', () => {

  let driver;
  const initialProps = {
    container,
    items: images2,
    styles: styleParams
  }

  beforeEach(() => {
    driver = new GalleryDriver();
  });

  it('should not render "itemHover" when "allowHover" is "false"', () => {
    Object.assign(initialProps.styles, {
      galleryLayout: 2,
      allowHover: false,
    })
    driver.mount.proGallery(initialProps);
    const items = driver.find.selector('.gallery-item-hover');
    //test 6 items for itemHover
    expect(items).to.have.lengthOf(0)
    driver.detach.proGallery();
  });
  it('should render "itemHover" when "allowHover" is "true"', () => {
    Object.assign(initialProps.styles, {
      galleryLayout: 2,
      allowHover: true,
    })
    driver.mount.proGallery(initialProps);
    const items = driver.find.selector('.gallery-item-hover');
    //test 6 items for itemHover
    expect(items).to.have.lengthOf(6)
    driver.detach.proGallery();
  });
})