From 0e496e094b6be4fc81607fc9b7ddf200a539afa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B3=E5=BB=B7=E5=AE=89?= <73953029+nrps9909@users.noreply.github.com> Date: Fri, 28 Aug 2026 04:54:01 +0800 Subject: [PATCH] fix: render custom step icons --- src/Step.tsx | 2 +- tests/__snapshots__/index.test.tsx.snap | 14 +++++++++++--- tests/index.test.tsx | 4 ++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Step.tsx b/src/Step.tsx index 098db38..ecb8a99 100644 --- a/src/Step.tsx +++ b/src/Step.tsx @@ -139,7 +139,7 @@ export default function Step(props: StepProps) { itemClassNames.root, ); - let iconNode = ; + let iconNode = {icon}; if (iconRender) { iconNode = iconRender(iconNode, { ...renderInfo, diff --git a/tests/__snapshots__/index.test.tsx.snap b/tests/__snapshots__/index.test.tsx.snap index 36a560c..250ea1b 100644 --- a/tests/__snapshots__/index.test.tsx.snap +++ b/tests/__snapshots__/index.test.tsx.snap @@ -1342,7 +1342,11 @@ exports[`Steps should render customIcon correctly 1`] = ` >
+ > + +
@@ -1369,7 +1373,9 @@ exports[`Steps should render customIcon correctly 1`] = ` >
+ > + apple +
@@ -1396,7 +1402,9 @@ exports[`Steps should render customIcon correctly 1`] = ` >
+ > + github +
diff --git a/tests/index.test.tsx b/tests/index.test.tsx index f31d169..3d793d0 100644 --- a/tests/index.test.tsx +++ b/tests/index.test.tsx @@ -186,6 +186,10 @@ describe('Steps', () => { ]} />, ); + const iconNodes = container.querySelectorAll('.rc-steps-item-icon'); + expect(iconNodes[0].querySelector('.rcicon-cloud')).toBeInTheDocument(); + expect(iconNodes[1]).toHaveTextContent('apple'); + expect(iconNodes[2]).toHaveTextContent('github'); expect(container.firstChild).toMatchSnapshot(); });