{"size": 753, "ext": "js", "max_stars_repo_path": "modules/geohash/bigquery/test/integration/GEOHASH_BOUNDARY.test.js", "max_stars_repo_name": "mhconradt/analytics-toolbox-core", "max_stars_repo_stars_event_min_datetime": "2021-02-11T21:52:02.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-08T05:35:06.000Z", "max_issues_repo_path": "modules/geohash/bigquery/test/integration/GEOHASH_BOUNDARY.test.js", "max_issues_repo_name": "mhconradt/analytics-toolbox-core", "max_issues_repo_issues_event_min_datetime": "2021-02-12T06:44:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-07T09:07:42.000Z", "max_forks_repo_path": "modules/geohash/bigquery/test/integration/GEOHASH_BOUNDARY.test.js", "max_forks_repo_name": "mhconradt/analytics-toolbox-core", "max_forks_repo_forks_event_min_datetime": "2021-04-22T08:46:06.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-05T18:39:20.000Z"}
{"max_stars_count": 46, "max_issues_count": 165, "max_forks_count": 7, "avg_line_length": 50.2, "max_line_length": 163, "alphanum_fraction": 0.6719787517}
const { runQuery } = require('../../../../../common/bigquery/test-utils');

test('GEOHASH_BOUNDARY should work', async () => {
    const query = 'SELECT ST_ASTEXT(`@@BQ_PREFIX@@carto.GEOHASH_BOUNDARY`(\'ezrq\')) AS output';
    const rows = await runQuery(query);
    expect(rows.length).toEqual(1);
    expect(rows[0].output).toEqual('POLYGON((-1.0546875 41.8359375, -0.703125 41.8359375, -0.703125 42.01171875, -1.0546875 42.01171875, -1.0546875 41.8359375))');
});

test('GEOHASH_BOUNDARY should return NULL for invalid input', async () => {
    const query = 'SELECT `@@BQ_PREFIX@@carto.GEOHASH_BOUNDARY`(\'error\') AS output';
    const rows = await runQuery(query);
    expect(rows.length).toEqual(1);
    expect(rows[0].output).toEqual(null);
});