-
-
Notifications
You must be signed in to change notification settings - Fork 174
Description
Two core UI components contain branching logic and behavior that can fail silently, but currently do not have dedicated unit tests.
This creates a gap in regression safety for rendering, security, and conditional UI behavior.
Affected files (exact paths)
asyncapi-react/library/src/components/Markdown.tsx
asyncapi-react/library/src/components/Tag.tsx
Why tests are required
- Markdown.tsx
This component handles three distinct render paths and performs HTML injection after sanitization, which is security- and rendering-critical.
Why this needs tests:
Multiple conditional branches (null, non-string, string)
Uses dangerouslySetInnerHTML
Depends on renderMarkdown + sanitize
A regression here would break docs rendering or introduce security risk without throwing errors
- Tag.tsx
This component conditionally changes the rendered DOM structure based on AsyncAPI parser data (externalDocs).
Why this needs tests:
Two different render outputs (wrapped vs non-wrapped)
Depends on @asyncapi/parser interfaces
Easily breakable during refactors without visible runtime errors