diff --git a/components/float-button/__tests__/index.test.tsx b/components/float-button/__tests__/index.test.tsx index 4ab7800b33..c4fddca2e6 100644 --- a/components/float-button/__tests__/index.test.tsx +++ b/components/float-button/__tests__/index.test.tsx @@ -70,4 +70,16 @@ describe('FloatButton', () => { const result2 = getOffset(1); expect(result2).not.toBe(0); }); + + it('support badge number', () => { + const { container } = render(); + const badgeElement = container?.querySelector('.ant-float-btn .ant-badge'); + expect(badgeElement?.querySelector('.ant-badge-count')).toBeTruthy(); + }); + + it('support badge dot', () => { + const { container } = render(); + const badgeElement = container?.querySelector('.ant-float-btn .ant-badge'); + expect(badgeElement?.querySelector('.ant-badge-dot')).toBeTruthy(); + }); }); diff --git a/components/float-button/index.en-US.md b/components/float-button/index.en-US.md index e54ec81b3b..3fc4abdf95 100644 --- a/components/float-button/index.en-US.md +++ b/components/float-button/index.en-US.md @@ -46,7 +46,7 @@ FloatButton. Available since `5.0.0`. | onClick | Set the handler to handle `click` event | (event) => void | - | | | href | The target of hyperlink | string | - | | | target | Specifies where to display the linked URL | string | - | | -| badge | float-button with round logo number | refer [badge](/components/badge#api) | - | 5.4.0 | +| badge | Attach Badge to FloatButton. `status` `size` and other props related are not supported. | [BadgeProps](/components/badge#api) | - | 5.4.0 | ### FloatButton.Group diff --git a/components/float-button/index.zh-CN.md b/components/float-button/index.zh-CN.md index 8b9100eb1b..5dc9e163c3 100644 --- a/components/float-button/index.zh-CN.md +++ b/components/float-button/index.zh-CN.md @@ -47,7 +47,7 @@ demo: | onClick | 点击按钮时的回调 | (event) => void | - | | | href | 点击跳转的地址,指定此属性 button 的行为和 a 链接一致 | string | - | | | target | 相当于 a 标签的 target 属性,href 存在时生效 | string | - | | -| badge | 带圆形徽标数字的悬浮按钮 | 参考[badge](/components/badge-cn#api) | - | 5.4.0 | +| badge | 带徽标数字的悬浮按钮(不支持 `status` `size` 以及相关属性) | [BadgeProps](/components/badge-cn#api) | - | 5.4.0 | ### FloatButton.Group