{"size": 832, "ext": "js", "max_stars_repo_path": "microservices/google-places/src/place-builder.test.js", "max_stars_repo_name": "maxmedina05/places-api", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "microservices/google-places/src/place-builder.test.js", "max_issues_repo_name": "maxmedina05/places-api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "microservices/google-places/src/place-builder.test.js", "max_forks_repo_name": "maxmedina05/places-api", "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": 43.7894736842, "max_line_length": 151, "alphanum_fraction": 0.7067307692}
const { buildPlace } = require("./place-builder");
const GOOGLE_PLACES_RESPONSE = require("./google-places-results.mock.json");

describe("Place Builder", () => {
  it("should build a place with the following properties: ID, Provider, Name, Description, Location, Address, Uri from a Google Place Result.", () => {
    const result = GOOGLE_PLACES_RESPONSE.results[0];
    const providerName = "Dummy Provider";

    const place = buildPlace(result, providerName, "");
    expect(place).toHaveProperty("id", result.place_id);
    expect(place).toHaveProperty("provider", providerName);
    expect(place).toHaveProperty("name", result.name);
    expect(place).toHaveProperty("description");
    expect(place).toHaveProperty("location");
    expect(place).toHaveProperty("address");
    expect(place).toHaveProperty("uri");
  });
});
