@@ -2011,7 +2011,7 @@ describe('Select.Basic', () => {
20112011 [ undefined ] . forEach ( ( value ) => {
20122012 it ( `to ${ value } ` , ( ) => {
20132013 const { container, rerender } = render ( < Select value = "light" /> ) ;
2014- expect ( container . querySelector ( '.rc-select-content-value' ) . textContent ) . toEqual ( 'light' ) ;
2014+ expect ( findSelection ( container ) . textContent ) . toEqual ( 'light' ) ;
20152015
20162016 rerender ( < Select value = { value } /> ) ;
20172017 expect ( container . querySelector ( '.rc-select-content-value' ) ) . toBeFalsy ( ) ;
@@ -2133,7 +2133,7 @@ describe('Select.Basic', () => {
21332133 toggleOpen ( container ) ;
21342134 selectItem ( container , index ) ;
21352135 expect ( onChange ) . toHaveBeenCalledWith ( value , expect . anything ( ) ) ;
2136- expect ( container . querySelector ( '.rc-select-content-value' ) . textContent ) . toEqual ( showValue ) ;
2136+ expect ( findSelection ( container ) . textContent ) . toEqual ( showValue ) ;
21372137 } ) ;
21382138
21392139 expect ( errorSpy ) . toHaveBeenCalledWith ( warningMessage ) ;
@@ -2399,9 +2399,7 @@ describe('Select.Basic', () => {
23992399 < Select value = "b" options = { [ { label : 'bamboo' , title : 'TitleBamboo' , value : 'b' } ] } /> ,
24002400 ) ;
24012401
2402- expect ( container . querySelector ( '.rc-select-content-value' ) . getAttribute ( 'title' ) ) . toEqual (
2403- 'TitleBamboo' ,
2404- ) ;
2402+ expect ( findSelection ( container ) . getAttribute ( 'title' ) ) . toEqual ( 'TitleBamboo' ) ;
24052403 } ) ;
24062404
24072405 it ( 'multiple' , ( ) => {
@@ -2455,17 +2453,15 @@ describe('Select.Basic', () => {
24552453 it ( 'should support title' , ( ) => {
24562454 const { container : container1 } = render ( < Select defaultValue = "lucy" options = { [ ] } /> ) ;
24572455 expect ( container1 . querySelector ( '.rc-select' ) . getAttribute ( 'title' ) ) . toBeFalsy ( ) ;
2458- expect ( container1 . querySelector ( '.rc-select-content-value' ) . getAttribute ( 'title' ) ) . toBe ( 'lucy' ) ;
2456+ expect ( findSelection ( container1 ) . getAttribute ( 'title' ) ) . toBe ( 'lucy' ) ;
24592457 const { container : container2 } = render ( < Select defaultValue = "lucy" options = { [ ] } title = "" /> ) ;
24602458 expect ( container2 . querySelector ( '.rc-select' ) . getAttribute ( 'title' ) ) . toBeFalsy ( ) ;
2461- expect ( container2 . querySelector ( '.rc-select-content-value' ) . getAttribute ( 'title' ) ) . toBe ( '' ) ;
2459+ expect ( findSelection ( container2 ) . getAttribute ( 'title' ) ) . toBe ( '' ) ;
24622460 const { container : container3 } = render (
24632461 < Select defaultValue = "lucy" options = { [ ] } title = "title" /> ,
24642462 ) ;
24652463 expect ( container3 . querySelector ( '.rc-select' ) . getAttribute ( 'title' ) ) . toBe ( 'title' ) ;
2466- expect ( container3 . querySelector ( '.rc-select-content-value' ) . getAttribute ( 'title' ) ) . toBe (
2467- 'title' ,
2468- ) ;
2464+ expect ( findSelection ( container3 ) . getAttribute ( 'title' ) ) . toBe ( 'title' ) ;
24692465 } ) ;
24702466
24712467 it ( 'scrollbar should be left position with rtl direction' , ( ) => {
0 commit comments