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

inclusion-numerique / la-base / d5f5ac4a-8b8f-47ad-a819-64f2e011fdb2

01 Apr 2026 09:05AM UTC coverage: 8.293% (-0.07%) from 8.36%
d5f5ac4a-8b8f-47ad-a819-64f2e011fdb2

Pull #400

circleci

KGALLET
chore: last changes
Pull Request #400: fix: contre audit rgaa

280 of 6384 branches covered (4.39%)

Branch coverage included in aggregate %.

0 of 122 new or added lines in 19 files covered. (0.0%)

8 existing lines in 7 files now uncovered.

1132 of 10643 relevant lines covered (10.64%)

0.59 hits per line

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

0.0
/packages/ui/src/components/navigationSideMenuUtils.ts
1
import type { SideMenuProps } from '@codegouvfr/react-dsfr/SideMenu'
2

3
export const isItemActive = (activeHref: string, item: SideMenuProps.Item) =>
×
4
  'linkProps' in item && item.linkProps?.href === activeHref
×
5

NEW
6
const isAnchorNavigationItem = (item: SideMenuProps.Item) =>
×
NEW
7
  'linkProps' in item &&
×
8
  typeof item.linkProps?.href === 'string' &&
9
  item.linkProps.href.startsWith('#')
10

UNCOV
11
export const addActiveStateToItems = (
×
12
  items: SideMenuProps.Item[],
13
  activeHref?: string | null,
14
  isFirstRecursion = true,
×
15
): SideMenuProps.Item[] =>
16
  items.map((item, index) => {
×
17
    if ('items' in item) {
×
18
      return {
×
19
        expandedByDefault: activeHref
×
20
          ? item.items.some((subItem) => isItemActive(activeHref, subItem))
×
21
          : index === 0,
22
        ...item,
23
        items: addActiveStateToItems(item.items, activeHref, index === 0),
24
      }
25
    }
26

NEW
27
    const isActive = activeHref
×
28
      ? isItemActive(activeHref, item)
29
      : index === 0 && isFirstRecursion
×
30

NEW
31
    if (isAnchorNavigationItem(item)) {
×
NEW
32
      return {
×
33
        ...item,
34
        linkProps: {
35
          ...item.linkProps,
36
          'aria-current': isActive ? 'location' : undefined,
×
37
        },
38
        // Keep false to avoid DSFR forcing aria-current="page" for active items.
39
        isActive: false,
40
      }
41
    }
42

UNCOV
43
    return {
×
44
      ...item,
45
      isActive,
46
    }
47
  })
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