Fix AREA MEDIAN INCOME prop on map (#860)

- add indicator values of selected CBG to console
- update snapshots
- update cypress tests (failure on zoom)
This commit is contained in:
Vim 2021-11-05 08:43:47 -07:00 committed by GitHub
parent 28c5b9c869
commit 68014c94e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 12 deletions

View file

@ -12,9 +12,9 @@ describe('Will it zoom into territories correctly?', () => {
// Removing z as each tests has variance on it's value // Removing z as each tests has variance on it's value
const tests = { const tests = {
'Lower 48': '/38.07/-95.87', 'Lower 48': '/38.07/-95.87',
'Puerto Rico': '/18.2/-66.583',
// Todo: Understand what causes these two to hang intermittently ticket #579 // Todo: Understand what causes these two to hang intermittently ticket #579
// 'Puerto Rico': '/18.2/-66.583',
// 'Alaska': '/63.28/-162.39', // 'Alaska': '/63.28/-162.39',
// 'Hawaii': '5.35/20.574/-161.438', // 'Hawaii': '5.35/20.574/-161.438',
}; };

View file

@ -65,7 +65,7 @@ const AreaDetail = ({properties}:IAreaDetailProps) => {
const areaMedianIncome:indicatorInfo = { const areaMedianIncome:indicatorInfo = {
label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.AREA_MEDIAN_INCOME), label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.AREA_MEDIAN_INCOME),
description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.AREA_MEDIAN_INCOME), description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.AREA_MEDIAN_INCOME),
value: properties[constants.POVERTY_PROPERTY_PERCENTILE], value: properties[constants.AREA_MEDIAN_INCOME_PERCENTILE],
}; };
const eduInfo:indicatorInfo = { const eduInfo:indicatorInfo = {
label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.EDUCATION), label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.EDUCATION),

View file

@ -68,7 +68,7 @@ exports[`rendering of the AreaDetail checks if various text fields are visible 1
Area Median Income Area Median Income
</h4> </h4>
<div> <div>
9900 19
<sup> <sup>
<span> <span>
th th
@ -90,7 +90,7 @@ exports[`rendering of the AreaDetail checks if various text fields are visible 1
Education, less than high school Education, less than high school
</h4> </h4>
<div> <div>
9800 98
<sup> <sup>
<span> <span>
th th
@ -112,7 +112,7 @@ exports[`rendering of the AreaDetail checks if various text fields are visible 1
Poverty Poverty
</h4> </h4>
<div> <div>
9900 12
<sup> <sup>
<span> <span>
th th
@ -266,7 +266,7 @@ exports[`rendering of the AreaDetail checks if various text fields are visible 1
Housing cost burden Housing cost burden
</h4> </h4>
<div> <div>
9500 95
<sup> <sup>
<span> <span>
th th

View file

@ -7,14 +7,15 @@ import * as constants from '../../../data/constants';
describe('rendering of the AreaDetail', () => { describe('rendering of the AreaDetail', () => {
const properties = { const properties = {
[constants.POVERTY_PROPERTY_PERCENTILE]: 99, [constants.POVERTY_PROPERTY_PERCENTILE]: .12,
[constants.EDUCATION_PROPERTY_PERCENTILE]: 98, [constants.EDUCATION_PROPERTY_PERCENTILE]: .98,
[constants.LINGUISTIC_ISOLATION_PROPERTY_PERCENTILE]: 97, [constants.LINGUISTIC_ISOLATION_PROPERTY_PERCENTILE]: .97,
[constants.UNEMPLOYMENT_PROPERTY_PERCENTILE]: 96, [constants.UNEMPLOYMENT_PROPERTY_PERCENTILE]: .96,
[constants.HOUSING_BURDEN_PROPERTY_PERCENTILE]: 95, [constants.HOUSING_BURDEN_PROPERTY_PERCENTILE]: .95,
[constants.SCORE_PROPERTY_HIGH]: 95, [constants.SCORE_PROPERTY_HIGH]: .95,
[constants.GEOID_PROPERTY]: 98729374234, [constants.GEOID_PROPERTY]: 98729374234,
[constants.TOTAL_POPULATION]: 3435435, [constants.TOTAL_POPULATION]: 3435435,
[constants.AREA_MEDIAN_INCOME_PERCENTILE]: .19,
}; };
const {asFragment} = render( const {asFragment} = render(

View file

@ -90,6 +90,7 @@ const J40Map = ({location}: IJ40Interface) => {
); );
if (feature.id !== selectedFeatureId) { if (feature.id !== selectedFeatureId) {
setSelectedFeature(feature); setSelectedFeature(feature);
console.log(feature.properties);
} else { } else {
setSelectedFeature(undefined); setSelectedFeature(undefined);
} }

View file

@ -59,6 +59,7 @@ export const WASTEWATER_PERCENTILE = 'Wastewater discharge (percentile)';
export const LEAD_PAINT_PERCENTILE = 'Percent pre-1960s housing (lead paint indicator) (percentile)'; export const LEAD_PAINT_PERCENTILE = 'Percent pre-1960s housing (lead paint indicator) (percentile)';
export const DIESEL_MATTER_PERCENTILE = 'Diesel particulate matter (percentile)'; export const DIESEL_MATTER_PERCENTILE = 'Diesel particulate matter (percentile)';
export const PM25_PERCENTILE = 'Particulate matter (PM2.5) (percentile)'; export const PM25_PERCENTILE = 'Particulate matter (PM2.5) (percentile)';
export const AREA_MEDIAN_INCOME_PERCENTILE = 'Median household income (% of AMI) (percentile)';
export type J40Properties = { [key: string]: any }; export type J40Properties = { [key: string]: any };