• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cfpb / ccdb5-ui / 24524572619

16 Apr 2026 05:31PM UTC coverage: 88.168%. First build
24524572619

Pull #601

github

web-flow
Merge 4bc0dd104 into cc4997e5a
Pull Request #601: Map tab optimizations

1172 of 1430 branches covered (81.96%)

Branch coverage included in aggregate %.

168 of 266 new or added lines in 19 files covered. (63.16%)

2591 of 2838 relevant lines covered (91.3%)

228.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/components/Map/MapToolbar.js
1
import './MapToolbar.scss';
2
import { useDispatch, useSelector } from 'react-redux';
3
import { Button } from '@cfpb/design-system-react';
4
import { THESE_UNITED_STATES } from '../../constants';
5
import {
6
  stateFilterCleared,
7
  stateFilterRemoved,
8
} from '../../reducers/filters/filtersSlice';
9
import { selectFiltersState } from '../../reducers/filters/selectors';
10
import { Pill } from '../Search/Pill';
11
import { formatStateLabel } from '../../utils/filters';
12

13
export const MapToolbar = () => {
5✔
14
  const dispatch = useDispatch();
7✔
15
  const stateFilters = useSelector(selectFiltersState) || [];
7!
16
  const filteredStates = stateFilters.filter(
7✔
17
    (state) => state in THESE_UNITED_STATES,
2✔
18
  );
19
  const hasFilters = filteredStates.length > 0;
7✔
20

21
  return (
7✔
22
    !!hasFilters && (
8✔
23
      <div className="map-toolbar">
24
        <section className="state-heading">
25
          <span className="state-heading__title">State filters applied</span>
26
        </section>
27
        <section className="state-filters">
28
          <ul className="state-filters__list m-tag-group">
29
            {filteredStates.map((abbr) => (
30
              <Pill
2✔
31
                key={abbr}
32
                fieldName="state"
33
                value={abbr}
34
                displayValue={formatStateLabel(abbr)}
NEW
35
                onRemove={() => dispatch(stateFilterRemoved({ abbr }))}
×
36
              />
37
            ))}
38
            <li className="state-filters__clear">
39
              <Button
40
                appearance="warning"
41
                label="Clear state filters"
42
                isLink
43
                aria-label="Clear all state filters"
44
                className="state-filters__clear-button"
45
                onClick={() => {
46
                  dispatch(stateFilterCleared());
1✔
47
                }}
48
              />
49
            </li>
50
          </ul>
51
        </section>
52
      </div>
53
    )
54
  );
55
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc