@@ -595,18 +595,16 @@ describe('Select.Basic', () => {
595595 expect ( wrapper . find ( '.rc-select' ) . getDOMNode ( ) . className ) . toContain ( '-focus' ) ;
596596 } ) ;
597597
598- it ( 'click placeholder should trigger onFocus ' , ( ) => {
599- const wrapper2 = mount (
598+ it ( 'focus input when placeholder is clicked ' , ( ) => {
599+ const wrapper = mount (
600600 < Select placeholder = "xxxx" >
601601 < Option value = "1" > 1</ Option >
602602 < Option value = "2" > 2</ Option >
603603 </ Select > ,
604604 ) ;
605-
606- const inputSpy = jest . spyOn ( wrapper2 . find ( 'input' ) . instance ( ) , 'focus' as any ) ;
607-
608- wrapper2 . find ( '.rc-select-selection-placeholder' ) . simulate ( 'mousedown' ) ;
609- wrapper2 . find ( '.rc-select-selection-placeholder' ) . simulate ( 'click' ) ;
605+ const inputSpy = jest . spyOn ( wrapper . find ( 'input' ) . instance ( ) , 'focus' as any ) ;
606+ wrapper . find ( '.rc-select-selection-placeholder' ) . simulate ( 'mousedown' ) ;
607+ wrapper . find ( '.rc-select-selection-placeholder' ) . simulate ( 'click' ) ;
610608 expect ( inputSpy ) . toHaveBeenCalled ( ) ;
611609 } ) ;
612610 } ) ;
@@ -816,19 +814,6 @@ describe('Select.Basic', () => {
816814 expectOpen ( wrapper , false ) ;
817815 } ) ;
818816
819- it ( 'focus input when placeholder is clicked' , ( ) => {
820- const wrapper = mount (
821- < Select placeholder = "select" >
822- < Option value = "1" > 1</ Option >
823- </ Select > ,
824- ) ;
825-
826- const focusSpy = jest . spyOn ( wrapper . find ( 'input' ) . instance ( ) , 'focus' as any ) ;
827- wrapper . find ( '.rc-select-selection-placeholder' ) . simulate ( 'mousedown' ) ;
828- wrapper . find ( '.rc-select-selection-placeholder' ) . simulate ( 'click' ) ;
829- expect ( focusSpy ) . toHaveBeenCalled ( ) ;
830- } ) ;
831-
832817 describe ( 'combobox could customize input element' , ( ) => {
833818 it ( 'work' , ( ) => {
834819 const onKeyDown = jest . fn ( ) ;
@@ -1736,32 +1721,6 @@ describe('Select.Basic', () => {
17361721 } ) ;
17371722 } ) ;
17381723
1739- describe ( 'show placeholder' , ( ) => {
1740- it ( 'when searchValue is controlled' , ( ) => {
1741- const wrapper = mount ( < Select searchValue = "light" placeholder = "bamboo" /> ) ;
1742- expect (
1743- wrapper . find ( '.rc-select-selection-placeholder' ) . getDOMNode ( ) . hasAttribute ( 'style' ) ,
1744- ) . toBe ( false ) ;
1745- toggleOpen ( wrapper ) ;
1746- expect (
1747- ( wrapper . find ( '.rc-select-selection-placeholder' ) . getDOMNode ( ) as HTMLSpanElement ) . style
1748- . visibility ,
1749- ) . toBe ( 'hidden' ) ;
1750- } ) ;
1751-
1752- it ( 'when value is null' , ( ) => {
1753- const wrapper = mount ( < Select value = { null } placeholder = "bamboo" /> ) ;
1754- expect ( wrapper . find ( '.rc-select-selection-placeholder' ) . length ) . toBeTruthy ( ) ;
1755- } ) ;
1756-
1757- it ( 'not when value is null but it is an Option' , ( ) => {
1758- const wrapper = mount (
1759- < Select value = { null } placeholder = "bamboo" options = { [ { value : null , label : 'light' } ] } /> ,
1760- ) ;
1761- expect ( wrapper . find ( '.rc-select-selection-placeholder' ) . length ) . toBeFalsy ( ) ;
1762- } ) ;
1763- } ) ;
1764-
17651724 it ( 'Remove options can keep the cache' , ( ) => {
17661725 const wrapper = mount ( < Select value = { 903 } options = { [ { value : 903 , label : 'Bamboo' } ] } /> ) ;
17671726 expect ( findSelection ( wrapper ) . text ( ) ) . toEqual ( 'Bamboo' ) ;
@@ -1894,16 +1853,6 @@ describe('Select.Basic', () => {
18941853 expect ( onClick ) . toHaveBeenCalled ( ) ;
18951854 } ) ;
18961855
1897- it ( 'should hide placeholder if force closed and showSearch with searchValue' , ( ) => {
1898- const wrapper = mount (
1899- < Select showSearch searchValue = "search" open = { false } placeholder = "placeholder" /> ,
1900- ) ;
1901- expect (
1902- ( wrapper . find ( '.rc-select-selection-placeholder' ) . getDOMNode ( ) as HTMLSpanElement ) . style
1903- . visibility ,
1904- ) . toBe ( 'hidden' ) ;
1905- } ) ;
1906-
19071856 it ( 'no warning for non-dom attr' , ( ) => {
19081857 const wrapper = mount (
19091858 < Select open >
0 commit comments