diff --git a/test/platform-routes.test.js b/test/platform-routes.test.js index 52ff83b..ddf1582 100644 --- a/test/platform-routes.test.js +++ b/test/platform-routes.test.js @@ -49,17 +49,17 @@ describe('Platform Routes HTTP request handler', () => { describe('GET /stations/daily', () => { it('returns daily station metrics for the given date range', async () => { await givenDailyStationMetrics(pgPool, '2024-01-10', [ - { station_id: 'station1', honest_measurement_count: 1 } + { station_id: 'station1', accepted_measurement_count: 1 } ]) await givenDailyStationMetrics(pgPool, '2024-01-11', [ - { station_id: 'station2', honest_measurement_count: 1 } + { station_id: 'station2', accepted_measurement_count: 1 } ]) await givenDailyStationMetrics(pgPool, '2024-01-12', [ - { station_id: 'station2', honest_measurement_count: 2 }, - { station_id: 'station3', honest_measurement_count: 1 } + { station_id: 'station2', accepted_measurement_count: 2 }, + { station_id: 'station3', accepted_measurement_count: 1 } ]) await givenDailyStationMetrics(pgPool, '2024-01-13', [ - { station_id: 'station1', honest_measurement_count: 1 } + { station_id: 'station1', accepted_measurement_count: 1 } ]) const res = await fetch( @@ -111,12 +111,12 @@ describe('Platform Routes HTTP request handler', () => { const givenDailyStationMetrics = async (pgPool, day, stationStats) => { await pgPool.query(` - INSERT INTO daily_stations (day, station_id, honest_measurement_count) - SELECT $1 AS day, UNNEST($2::text[]) AS station_id, UNNEST($3::int[]) AS honest_measurement_count + INSERT INTO daily_stations (day, station_id, accepted_measurement_count) + SELECT $1 AS day, UNNEST($2::text[]) AS station_id, UNNEST($3::int[]) AS accepted_measurement_count ON CONFLICT DO NOTHING `, [ day, stationStats.map(s => s.station_id), - stationStats.map(s => s.honest_measurement_count) + stationStats.map(s => s.accepted_measurement_count) ]) }