Skip to content

Fix icon async test warnings and align component typing style#555

Open
flacoman91 wants to merge 10 commits intomainfrom
rad-async-import-fix
Open

Fix icon async test warnings and align component typing style#555
flacoman91 wants to merge 10 commits intomainfrom
rad-async-import-fix

Conversation

@flacoman91
Copy link
Copy Markdown
Collaborator

@flacoman91 flacoman91 commented Apr 21, 2026

I went in to clean up warnings being thrown in CE and CCDB jest tests related to icons getting loaded async and went down a rabbit hole of fixing other warnings and nags:

  • Fixed React test act warnings for async SVG icon loading and restored icon rendering in tests.
  • Resolved lint/type issues across components and tests, including safer typing for CFPB expandables/web components and Storybook args.
  • Cleaned up typing style by replacing React.* type usage with direct type imports.
  • Improved test robustness by avoiding Testing Library node access, removing unsafe any usage, and adding stable test IDs.
  • Standardized nullable component return types to use the shared JSXElement alias.
  • Updated local CFPB design-system type declarations and added missing module typings.
  • Prevented nested <li> rendering by treating ListLink as already wrapped, eliminating hydration warnings in TextIntroduction and Well call‑to‑action lists.
    Verification of this requires a dev to run their own tests in their own app. these warnings should not be there anymore.
Screenshot 2026-04-20 at 5 12 27 PM Screenshot 2026-04-21 at 10 07 11 AM Screenshot 2026-04-21 at 10 07 01 AM

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cfpb.github.io/design-system-react/pr-previews/pr-555/

Built to branch gh-pages at 2026-04-21 22:28 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

…pbTagline.

* Tightened @cfpb/cfpb-design-system/src/components/cfpb-expandables types to include Summary, SummaryMinimal, and *Styles, with correct init signatures.
* Removed unknown casts in summary.tsx, expandable-group.tsx, banner.tsx, and tagline.test.tsx.
* Adjusted Tagline stories to use name instead of storyName and satisfies Meta<...> for safe typing.
* Fixed Expandable stories args typing without relying on the global React namespace.
@flacoman91 flacoman91 changed the title add in check for async import to prevent jest testing errors Fix icon async test warnings and align component typing style Apr 21, 2026
…, eliminating hydration warnings in TextIntroduction and Well call‑to‑action lists.
@flacoman91 flacoman91 enabled auto-merge (squash) April 21, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant