From b0c7a714ad10b50164dad59a902e064be546c2ca Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Sun, 13 Nov 2016 15:53:02 +0800 Subject: [PATCH] Don't pass visible to Dropdown if it's not exits. (#3821) fix #3815 --- components/dropdown/dropdown-button.tsx | 19 ++++++++++++------- tests/dropdown/dropdown-button.test.js | 7 +++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/components/dropdown/dropdown-button.tsx b/components/dropdown/dropdown-button.tsx index aa5dcb853c..d478e8eddd 100644 --- a/components/dropdown/dropdown-button.tsx +++ b/components/dropdown/dropdown-button.tsx @@ -43,16 +43,21 @@ export default class DropdownButton extends React.Component - + diff --git a/tests/dropdown/dropdown-button.test.js b/tests/dropdown/dropdown-button.test.js index 471ec2c5db..c3c7d10d70 100644 --- a/tests/dropdown/dropdown-button.test.js +++ b/tests/dropdown/dropdown-button.test.js @@ -26,4 +26,11 @@ describe('DropdownButton', () => { expect(dropdownProps[key]).toBe(props[key]); }); }); + + it('don\'t pass visible to Dropdown if it\'s not exits', () => { + const wrapper = shallow(); + const dropdownProps = wrapper.find(Dropdown).props(); + + expect('visible' in dropdownProps).toBe(false); + }); });