{"size": 999, "ext": "js", "max_stars_repo_path": "scripts/reactComponentGenerator/generateReactComponent.test.js", "max_stars_repo_name": "jakubzet/flickr-photo-feed", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "scripts/reactComponentGenerator/generateReactComponent.test.js", "max_issues_repo_name": "jakubzet/flickr-photo-feed", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "scripts/reactComponentGenerator/generateReactComponent.test.js", "max_forks_repo_name": "jakubzet/flickr-photo-feed", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.2894736842, "max_line_length": 74, "alphanum_fraction": 0.6886886887}
/* global ENV_PROD_NAME */
const reactComponentGenerator = require("./generateReactComponent");

const {
  textStartsWithCapitalLetter,
  textHasProperLength
} = reactComponentGenerator;

describe("initialize", () => {
  it("Throw during initialization when not in development mode", () => {
    expect(() => {
      require("./index")(ENV_PROD_NAME);
    }).toThrow();
  });
});

describe("textStartsWithCapitalLetter", () => {
  it("Properly checks initial letter", () => {
    const validComponentName = "Valid";
    const invalidComponentName = "invalid";

    expect(textStartsWithCapitalLetter(validComponentName)).toBe(true);

    expect(textStartsWithCapitalLetter(invalidComponentName)).toBe(false);
  });
});

describe("textHasProperLength", () => {
  it("Properly checks string length", () => {
    const properString = "Valid";
    const shortString = "inv";

    expect(textHasProperLength(properString)).toBe(true);

    expect(textHasProperLength(shortString)).toBe(false);
  });
});
