{"size": 886, "ext": "js", "max_stars_repo_path": "src/resolvers/query/bounds/validation.test.js", "max_stars_repo_name": "brokalys/sls-map-api", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/resolvers/query/bounds/validation.test.js", "max_issues_repo_name": "brokalys/sls-map-api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/resolvers/query/bounds/validation.test.js", "max_forks_repo_name": "brokalys/sls-map-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": 31.6428571429, "max_line_length": 199, "alphanum_fraction": 0.6376975169}
import schema from './validation';

describe('buildings: validation', () => {
  test.each([
    [
      {
        bounds:
          '56.944756215513316 24.09404948877113, 56.9404253703127 24.09404948877113, 56.9404253703127 24.086952363717725, 56.944756215513316 24.086952363717725, 56.944756215513316 24.09404948877113',
      },
    ],
  ])('with valid data: %j', (data) => {
    expect(schema().validate(data).error).toBeUndefined();
  });

  test.each([
    [
      {
        bounds:
          '57.0510741522279 24.34369621296768, 56.86735048784755 24.34369621296768, 56.86735048784755 23.842917061051175, 57.0510741522279 23.842917061051175, 57.0510741522279 24.34369621296768',
      },
    ][{ unknown: 'field' }], // unknown root field
    [{}],
    [undefined],
  ])('with invalid data: %j', (data) => {
    expect(schema().validate(data).error).not.toBeUndefined();
  });
});
