Skip to content

refactor(badge): Improved badge component and tests#2089

Merged
rkaraivanov merged 1 commit intomasterfrom
rkaraivanov/badge-improvements
Feb 6, 2026
Merged

refactor(badge): Improved badge component and tests#2089
rkaraivanov merged 1 commit intomasterfrom
rkaraivanov/badge-improvements

Conversation

@rkaraivanov
Copy link
Member

Description

Improved badge component and tests

Type of Change

  • Documentation update
  • Refactoring (code improvements without functional changes)

Checklist

  • I have tested my changes locally
  • I have updated documentation if needed

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the badge component documentation and slot/icon handling, and expands unit test coverage around icon slotting.

Changes:

  • Clarified Storybook argTypes and inline docs for variant and dot.
  • Updated igc-badge JSDoc with more explicit API docs and examples, plus icon csspart documentation.
  • Simplified icon detection logic and added a unit test for the icon part when an igc-icon is slotted.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
stories/badge.stories.ts Improves Storybook control/docs wording for variant and dot.
src/components/badge/badge.ts Updates component JSDoc and refactors icon detection used for part="icon".
src/components/badge/badge.spec.ts Registers igc-icon for tests and adds coverage for part~="icon".

@rkaraivanov rkaraivanov merged commit e7d1bd6 into master Feb 6, 2026
7 checks passed
@rkaraivanov rkaraivanov deleted the rkaraivanov/badge-improvements branch February 6, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants