Change map legend color key (#732)

* Change map legend color key

- make legend key a circle
- remove blue border in legend
- remove blue border in color key of side panel

* Add space in CBG sub-headings

- update snaphots

* Add state to the AreaDetail component

- add useState to track the community of focus
- add useEffect to control rendering
- remove getCategorization()
- clean up all SASS around 'prioritization'
- add snapshots
This commit is contained in:
Vim 2021-09-23 08:06:49 -07:00 committed by GitHub
commit 94095ff4c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 104 deletions

View file

@ -1,10 +1,9 @@
import * as React from 'react';
import {render} from '@testing-library/react';
import AreaDetail, {getCategorization, readablePercentile} from '..';
import AreaDetail, {readablePercentile} from '..';
import {LocalizedComponent} from '../../../test/testHelpers';
import * as constants from '../../../data/constants';
import * as EXPLORE_COPY from '../../../data/copy/explore';
describe('rendering of the AreaDetail', () => {
const properties = {
@ -22,8 +21,7 @@ describe('rendering of the AreaDetail', () => {
<LocalizedComponent>
<AreaDetail properties={properties}/>
</LocalizedComponent>,
)
;
);
it('checks if various text fields are visible', () => {
expect(asFragment()).toMatchSnapshot();
@ -36,17 +34,3 @@ describe('tests the readablePercentile function', () => {
expect(readablePercentile(.123)).toEqual(12);
expect(readablePercentile(.789)).toEqual(79);
});
describe('tests the getCategorization function', () => {
it(`should equal Community of focus for value >= ${constants.SCORE_BOUNDARY_LOW}`, () => {
expect(getCategorization(.756)).toEqual([EXPLORE_COPY.COMMUNITY.OF_FOCUS, undefined]);
});
it(`should equal Threshold for .60 <= value < ${constants.SCORE_BOUNDARY_THRESHOLD}`, () => {
expect(getCategorization(.65)).toEqual([EXPLORE_COPY.COMMUNITY.NOT_OF_FOCUS, undefined]);
});
it(`should equal Non-prioritized for value < ${constants.SCORE_BOUNDARY_PRIORITIZED}`, () => {
expect(getCategorization(.53)).toEqual([EXPLORE_COPY.COMMUNITY.NOT_OF_FOCUS, undefined]);
});
});