diff --git a/src/OptionList.tsx b/src/OptionList.tsx index 4162743bd..9de61eae5 100644 --- a/src/OptionList.tsx +++ b/src/OptionList.tsx @@ -31,16 +31,8 @@ const OptionList: React.ForwardRefRenderFunction { - const { - prefixCls, - id, - open, - multiple, - searchValue, - toggleOpen, - notFoundContent, - onPopupScroll, - } = useBaseProps(); + const { prefixCls, id, open, multiple, searchValue, toggleOpen, notFoundContent, onPopupScroll } = + useBaseProps(); const { flattenOptions, onActiveValue, @@ -306,7 +298,8 @@ const OptionList: React.ForwardRefRenderFunction { jest.useRealTimers(); }); + it('should render 0 as text properly', () => { + const data = [ + { text: 0, value: '=0' }, + { text: 1, value: '=1' }, + ]; + + const wrapper = mount( + , + ); + + expect(wrapper.find('.rc-select-item-option-content').first().text()).toEqual('0'); + }); + describe('focus', () => { let handleFocus; let wrapper;