Skip to content

fix(module:segmented): correctly render with-icon & icon-only - #9367

Merged
Laffery merged 1 commit into
NG-ZORRO:masterfrom
HyperLife1119:fix/segmented-icon-only
Aug 31, 2025
Merged

fix(module:segmented): correctly render with-icon & icon-only#9367
Laffery merged 1 commit into
NG-ZORRO:masterfrom
HyperLife1119:fix/segmented-icon-only

Conversation

@HyperLife1119

Copy link
Copy Markdown
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@codecov

codecov Bot commented Aug 30, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.21%. Comparing base (52d61b8) to head (586a58c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9367      +/-   ##
==========================================
- Coverage   92.25%   92.21%   -0.04%     
==========================================
  Files         561      561              
  Lines       19680    19684       +4     
  Branches     3015     3015              
==========================================
- Hits        18156    18152       -4     
- Misses       1192     1200       +8     
  Partials      332      332              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Nicoss54 Nicoss54 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Nicoss54
Nicoss54 self-requested a review August 30, 2025 07:52
@Nicoss54 Nicoss54 added PR: need-test Test is necessary for code changes. PR: reviewed-changes-requested and removed PR: reviewed-approved PR: need-test Test is necessary for code changes. labels Aug 30, 2025

@Nicoss54 Nicoss54 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a question, the test added previously maybe need to be adapted ?

@HyperLife1119 WDYT :) ?

@HyperLife1119

Copy link
Copy Markdown
Collaborator Author

Yes, I'll add a more complete test later. @Nicoss54

@HyperLife1119 HyperLife1119 added the PR: need-test Test is necessary for code changes. label Aug 30, 2025
@HyperLife1119
HyperLife1119 force-pushed the fix/segmented-icon-only branch 2 times, most recently from 41fc8f4 to f34f1e7 Compare August 30, 2025 09:31
@HyperLife1119 HyperLife1119 changed the title fix(module:segmented): correctly render icon-only fix(module:segmented): correctly render with-icon & icon-only Aug 30, 2025
@HyperLife1119
HyperLife1119 force-pushed the fix/segmented-icon-only branch from f34f1e7 to 586a58c Compare August 30, 2025 09:55
@HyperLife1119 HyperLife1119 added PR: unreviewed and removed PR: reviewed-changes-requested PR: need-test Test is necessary for code changes. labels Aug 30, 2025
@HyperLife1119
HyperLife1119 requested review from Laffery and Nicoss54 and removed request for simplejason August 30, 2025 09:55
fixture.detectChanges();
});

it('should render an icon element and a text node with a wrapper element if the item is label-with-icon', () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: do we not need to inject the provideNzIconsTesting in the TestBed.configureTestingModule() providers options to avoid error on rendering icon ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Otherwise: LGTM

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

question: do we not need to inject the provideNzIconsTesting in the TestBed.configureTestingModule() providers options to avoid error on rendering icon ?

In theory, any icon used in a test should use provideNzIconsTesting, which registers all icons. However, zorro registers some built-in icons by default (see /components/icon/icons.ts). If I only use these built-in icons, I can avoid using provideNzIconsTesting :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ohhhh okkey i missed this information ! Thanks a lot 😀

@Laffery Laffery left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Laffery
Laffery merged commit 9d42b42 into NG-ZORRO:master Aug 31, 2025
8 of 10 checks passed
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.

3 participants