Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Updated unit tests to reflect changes to static best dates and new map tile image verification.

Jason Hurleyb207384c20b7
diff --git a/web/js/mapUI/components/kiosk/tile-measurement/utils/layer-data-eic.test.js b/web/js/mapUI/components/kiosk/tile-measurement/utils/layer-data-eic.test.js
index c99dd79c3..5edbdf7da 100644
--- a/web/js/mapUI/components/kiosk/tile-measurement/utils/layer-data-eic.test.js
+++ b/web/js/mapUI/components/kiosk/tile-measurement/utils/layer-data-eic.test.js
@@ -174,104 +174,104 @@ describe('bestDates', () => {
});
describe('individual layer best dates', () => {
- it('GOES-East_ABI_GeoColor has date 2023-10-30T23:50:00.000Z', () => {
- expect(bestDates['GOES-East_ABI_GeoColor'].date).toBe('2023-10-30T23:50:00.000Z');
+ it('GOES-East_ABI_GeoColor has date 2026-07-27T18:29:00.000Z', () => {
+ expect(bestDates['GOES-East_ABI_GeoColor'].date).toBe('2026-07-27T18:29:00.000Z');
});
- it('GOES-West_ABI_GeoColor has date 2023-10-30T23:50:00.000Z', () => {
- expect(bestDates['GOES-West_ABI_GeoColor'].date).toBe('2023-10-30T23:50:00.000Z');
+ it('GOES-West_ABI_GeoColor has date 2026-07-27T18:41:00.000Z', () => {
+ expect(bestDates['GOES-West_ABI_GeoColor'].date).toBe('2026-07-27T18:41:00.000Z');
});
- it('Himawari_AHI_Band3_Red_Visible_1km has date 2023-10-30T23:50:00.000Z', () => {
- expect(bestDates.Himawari_AHI_Band3_Red_Visible_1km.date).toBe('2023-10-30T23:50:00.000Z');
+ it('Himawari_AHI_Band3_Red_Visible_1km has date 2026-07-27T18:41:00.000Z', () => {
+ expect(bestDates.Himawari_AHI_Band3_Red_Visible_1km.date).toBe('2026-07-27T18:41:00.000Z');
});
- it('MODIS_Terra_CorrectedReflectance_TrueColor has date 2023-10-29', () => {
- expect(bestDates.MODIS_Terra_CorrectedReflectance_TrueColor.date).toBe('2023-10-29');
+ it('MODIS_Terra_CorrectedReflectance_TrueColor has date 2026-07-27', () => {
+ expect(bestDates.MODIS_Terra_CorrectedReflectance_TrueColor.date).toBe('2026-07-27');
});
- it('VIIRS_SNPP_DayNightBand_At_Sensor_Radiance has date 2023-10-30', () => {
- expect(bestDates.VIIRS_SNPP_DayNightBand_At_Sensor_Radiance.date).toBe('2023-10-30');
+ it('VIIRS_SNPP_DayNightBand_At_Sensor_Radiance has date 2026-07-27', () => {
+ expect(bestDates.VIIRS_SNPP_DayNightBand_At_Sensor_Radiance.date).toBe('2026-07-27');
});
- it('VIIRS_SNPP_CorrectedReflectance_TrueColor has date 2023-10-30', () => {
- expect(bestDates.VIIRS_SNPP_CorrectedReflectance_TrueColor.date).toBe('2023-10-30');
+ it('VIIRS_SNPP_CorrectedReflectance_TrueColor has date 2026-07-27', () => {
+ expect(bestDates.VIIRS_SNPP_CorrectedReflectance_TrueColor.date).toBe('2026-07-27');
});
- it('IMERG_Precipitation_Rate has date 2023-10-30', () => {
- expect(bestDates.IMERG_Precipitation_Rate.date).toBe('2023-10-30');
+ it('IMERG_Precipitation_Rate has date 2026-07-26', () => {
+ expect(bestDates.IMERG_Precipitation_Rate.date).toBe('2026-07-26');
});
- it('GHRSST_L4_MUR_Sea_Surface_Temperature has date 2023-10-30', () => {
- expect(bestDates.GHRSST_L4_MUR_Sea_Surface_Temperature.date).toBe('2023-10-30');
+ it('GHRSST_L4_MUR_Sea_Surface_Temperature has date 2026-07-26', () => {
+ expect(bestDates.GHRSST_L4_MUR_Sea_Surface_Temperature.date).toBe('2026-07-26');
});
- it('MODIS_Aqua_Land_Surface_Temp_Day has date 2023-10-30', () => {
- expect(bestDates.MODIS_Aqua_Land_Surface_Temp_Day.date).toBe('2023-10-30');
+ it('MODIS_Aqua_Land_Surface_Temp_Day has date 2026-07-26', () => {
+ expect(bestDates.MODIS_Aqua_Land_Surface_Temp_Day.date).toBe('2026-07-26');
});
- it('MODIS_Aqua_CorrectedReflectance_TrueColor has date 2023-10-29', () => {
- expect(bestDates.MODIS_Aqua_CorrectedReflectance_TrueColor.date).toBe('2023-10-29');
+ it('MODIS_Aqua_CorrectedReflectance_TrueColor has date 2026-07-26', () => {
+ expect(bestDates.MODIS_Aqua_CorrectedReflectance_TrueColor.date).toBe('2026-07-26');
});
- it('OMI_Nitrogen_Dioxide_Tropo_Column has date 2023-10-27', () => {
- expect(bestDates.OMI_Nitrogen_Dioxide_Tropo_Column.date).toBe('2023-10-27');
+ it('OMI_Nitrogen_Dioxide_Tropo_Column has date 2026-07-20', () => {
+ expect(bestDates.OMI_Nitrogen_Dioxide_Tropo_Column.date).toBe('2026-07-20');
});
- it('VIIRS_SNPP_AOD_Dark_Target_Land_Ocean has date 2023-10-29', () => {
- expect(bestDates.VIIRS_SNPP_AOD_Dark_Target_Land_Ocean.date).toBe('2023-10-29');
+ it('VIIRS_SNPP_AOD_Dark_Target_Land_Ocean has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_SNPP_AOD_Dark_Target_Land_Ocean.date).toBe('2026-07-26');
});
- it('VIIRS_SNPP_AOT_Deep_Blue_Best_Estimate has date 2023-10-30', () => {
- expect(bestDates.VIIRS_SNPP_AOT_Deep_Blue_Best_Estimate.date).toBe('2023-10-30');
+ it('VIIRS_SNPP_AOT_Deep_Blue_Best_Estimate has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_SNPP_AOT_Deep_Blue_Best_Estimate.date).toBe('2026-07-26');
});
- it('AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Night has date 2023-10-17', () => {
- expect(bestDates.AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Night.date).toBe('2023-10-17');
+ it('AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Night has date 2026-07-20', () => {
+ expect(bestDates.AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Night.date).toBe('2026-07-20');
});
- it('AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Day has date 2023-10-17', () => {
- expect(bestDates.AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Day.date).toBe('2023-10-17');
+ it('AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Day has date 2026-07-19', () => {
+ expect(bestDates.AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Day.date).toBe('2026-07-19');
});
- it('VIIRS_NOAA20_CorrectedReflectance_TrueColor has date 2023-10-30', () => {
- expect(bestDates.VIIRS_NOAA20_CorrectedReflectance_TrueColor.date).toBe('2023-10-30');
+ it('VIIRS_NOAA20_CorrectedReflectance_TrueColor has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_NOAA20_CorrectedReflectance_TrueColor.date).toBe('2026-07-26');
});
- it('CERES_EBAF_TOA_Shortwave_Flux_All_Sky_Monthly has date 2023-10-30', () => {
- expect(bestDates.CERES_EBAF_TOA_Shortwave_Flux_All_Sky_Monthly.date).toBe('2023-10-30');
+ it('CERES_EBAF_TOA_Shortwave_Flux_All_Sky_Monthly has date 2018-10-31', () => {
+ expect(bestDates.CERES_EBAF_TOA_Shortwave_Flux_All_Sky_Monthly.date).toBe('2018-10-31');
});
- it('TEMPO_L3_NO2_Vertical_Column_Troposphere has date 2024-06-03T17:00:00.000Z', () => {
- expect(bestDates.TEMPO_L3_NO2_Vertical_Column_Troposphere.date).toBe('2024-06-03T17:00:00.000Z');
+ it('TEMPO_L3_NO2_Vertical_Column_Troposphere has date 2026-07-27T17:13:00.000Z', () => {
+ expect(bestDates.TEMPO_L3_NO2_Vertical_Column_Troposphere.date).toBe('2026-07-27T17:13:00.000Z');
});
- it('TEMPO_L3_Ozone_Column_Amount has date 2024-06-03T17:00:00.000Z', () => {
- expect(bestDates.TEMPO_L3_Ozone_Column_Amount.date).toBe('2024-06-03T17:00:00.000Z');
+ it('TEMPO_L3_Ozone_Column_Amount has date 2026-07-27T17:13:00.000Z', () => {
+ expect(bestDates.TEMPO_L3_Ozone_Column_Amount.date).toBe('2026-07-27T17:13:00.000Z');
});
- it('VIIRS_NOAA20_DayNightBand_At_Sensor_Radiance has date 2024-10-01', () => {
- expect(bestDates.VIIRS_NOAA20_DayNightBand_At_Sensor_Radiance.date).toBe('2024-10-01');
+ it('VIIRS_NOAA20_DayNightBand_At_Sensor_Radiance has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_NOAA20_DayNightBand_At_Sensor_Radiance.date).toBe('2026-07-26');
});
- it('VIIRS_NOAA20_DayNightBand_AtSensor_M15 has date 2024-10-01', () => {
- expect(bestDates.VIIRS_NOAA20_DayNightBand_AtSensor_M15.date).toBe('2024-10-01');
+ it('VIIRS_NOAA20_DayNightBand_AtSensor_M15 has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_NOAA20_DayNightBand_AtSensor_M15.date).toBe('2026-07-26');
});
- it('VIIRS_NOAA20_AOT_Deep_Blue_Best_Estimate has date 2024-10-01', () => {
- expect(bestDates.VIIRS_NOAA20_AOT_Deep_Blue_Best_Estimate.date).toBe('2024-10-01');
+ it('VIIRS_NOAA20_AOT_Deep_Blue_Best_Estimate has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_NOAA20_AOT_Deep_Blue_Best_Estimate.date).toBe('2026-07-26');
});
- it('VIIRS_NOAA20_AOD_Dark_Target_Land_Ocean has date 2024-10-01', () => {
- expect(bestDates.VIIRS_NOAA20_AOD_Dark_Target_Land_Ocean.date).toBe('2024-10-01');
+ it('VIIRS_NOAA20_AOD_Dark_Target_Land_Ocean has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_NOAA20_AOD_Dark_Target_Land_Ocean.date).toBe('2026-07-26');
});
- it('VIIRS_NOAA21_CorrectedReflectance_TrueColor has date 2024-10-01', () => {
- expect(bestDates.VIIRS_NOAA21_CorrectedReflectance_TrueColor.date).toBe('2024-10-01');
+ it('VIIRS_NOAA21_CorrectedReflectance_TrueColor has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_NOAA21_CorrectedReflectance_TrueColor.date).toBe('2026-07-26');
});
- it('VIIRS_SNPP_NDVI_8Day has date 2025-08-24', () => {
- expect(bestDates.VIIRS_SNPP_NDVI_8Day.date).toBe('2025-08-24');
+ it('VIIRS_SNPP_NDVI_8Day has date 2026-07-26', () => {
+ expect(bestDates.VIIRS_SNPP_NDVI_8Day.date).toBe('2026-07-26');
});
});
});
diff --git a/web/js/mapUI/components/kiosk/tile-measurement/utils/verify-map-tiles.test.js b/web/js/mapUI/components/kiosk/tile-measurement/utils/verify-map-tiles.test.js
index ba2c3a959..8e083d913 100644
--- a/web/js/mapUI/components/kiosk/tile-measurement/utils/verify-map-tiles.test.js
+++ b/web/js/mapUI/components/kiosk/tile-measurement/utils/verify-map-tiles.test.js
@@ -29,10 +29,13 @@ function buildMockCanvas(ctx) {
function buildMockTile(state, imageOverride) {
const defaultImage = { complete: true, naturalWidth: 1, width: 2, height: 2 };
- return {
+ const tile = {
getState: jest.fn(() => state),
- image_: imageOverride ?? defaultImage,
+ getImage: jest.fn(() => imageOverride ?? defaultImage),
+ tileCoord: [0, 0, 0],
};
+ tile.getTileCoord = jest.fn(() => tile.tileCoord);
+ return tile;
}
function buildMockTileGrid(tiles = []) {
@@ -53,6 +56,13 @@ function buildMockSource(tiles = [], projectionOverride = null) {
getProjection: jest.fn(() => projectionOverride),
getTileGridForProjection: jest.fn(() => tileGrid),
getTile: jest.fn((z, x) => tileMap[x] ?? tiles[x]),
+ sourceTiles: tiles,
+ };
+}
+
+function buildMockTileCache(tiles = []) {
+ return {
+ forEach: jest.fn((cb) => tiles.forEach((tile) => cb(tile))),
};
}
@@ -60,6 +70,10 @@ function buildMockTileLayer(source, id = 'test-layer-id') {
const layer = new TileLayer();
layer.getSource = jest.fn(() => source);
layer.wv = { id };
+ const tiles = source.sourceTiles ?? [];
+ tiles.forEach((tile, i) => { tile.tileCoord = [5, i, 0]; });
+ const tileCache = buildMockTileCache(tiles);
+ layer.getRenderer = jest.fn(() => ({ getTileCache: jest.fn(() => tileCache) }));
return layer;
}
@@ -487,7 +501,7 @@ describe('countTilesForSpecifiedLayers', () => {
expect(source.getTileGridForProjection).toHaveBeenCalledWith(view.getProjection());
});
- it('calls source.getTile with correct tileCoord arguments', async () => {
+ it('looks up tiles from the renderer tile cache by tileCoord', async () => {
const tile = buildMockTile(4);
const source = buildMockSource([tile]);
const layer = buildMockTileLayer(source, 'layer-a');
@@ -495,7 +509,8 @@ describe('countTilesForSpecifiedLayers', () => {
countTilesForSpecifiedLayers(buildUi(map), ['layer-a']);
await Promise.resolve();
- expect(source.getTile).toHaveBeenCalledWith(5, 0, 0, 1, expect.anything());
+ expect(layer.getRenderer).toHaveBeenCalled();
+ expect(tile.getTileCoord).toHaveBeenCalled();
});
it('calls tileGrid.getZForResolution with the view resolution', async () => {