diff --git a/test/modules/carto/api/parse-map.spec.ts b/test/modules/carto/api/parse-map.spec.ts index 5d18eb311a8..517b72c4b1b 100644 --- a/test/modules/carto/api/parse-map.spec.ts +++ b/test/modules/carto/api/parse-map.spec.ts @@ -1929,7 +1929,7 @@ test(`parseMap#visState HeatmapTileLayer`, async t => { ], visConfig: { filled: true, - radius: 2, + radius: 17.3, opacity: 0.8, stroked: false, enable3d: false, @@ -1939,7 +1939,7 @@ test(`parseMap#visState HeatmapTileLayer`, async t => { colorRange: { name: 'Global Warming', type: 'sequential', - colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300'], + colors: ['#ff0000', '#00ff00', '#0000ff', '#fc8d59', '#e34a33', '#b30000'], category: 'Uber' }, heightRange: [0, 500], @@ -1968,7 +1968,8 @@ test(`parseMap#visState HeatmapTileLayer`, async t => { radiusField: null, radiusScale: 'linear', strokeColorField: null, - strokeColorScale: 'quantile' + strokeColorScale: 'quantile', + weightField: {name: 'ride_count', type: 'integer'} } } ], @@ -2015,11 +2016,20 @@ test(`parseMap#visState HeatmapTileLayer`, async t => { t.equal(heatmapTileLayer.props.visible, true, 'heatmapTileLayer - visible'); t.equal(heatmapTileLayer.props.filled, true, 'heatmapTileLayer - filled'); t.equal(heatmapTileLayer.props.stroked, false, 'heatmapTileLayer - stroked'); + t.equal(heatmapTileLayer.props.radiusPixels, 17.3, 'heatmapTileLayer - radiusPixels'); t.deepEqual( - heatmapTileLayer.props.getFillColor, - [246, 209, 138, 230], - 'heatmapTileLayer - getFillColor' + heatmapTileLayer.props.colorRange, + [ + [255, 0, 0, 255], + [0, 255, 0, 255], + [0, 0, 255, 255], + [252, 141, 89, 255], + [227, 74, 51, 255], + [179, 0, 0, 255] + ], + 'heatmapTileLayer - colorRange' ); + t.equal(typeof heatmapTileLayer.props.getWeight, 'function', 'heatmapTileLayer - getWeight'); t.equal((heatmapTileLayer.props as any).cartoLabel, 'Layer 2', 'heatmapTileLayer - cartoLabel'); t.end(); });