File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ const PaginationLink = (props) => {
4848 }
4949
5050 let children = props . children ;
51- if ( children && ! children . length ) {
51+ if ( children && Array . isArray ( children ) && children . length === 0 ) {
5252 children = null ;
5353 }
5454
Original file line number Diff line number Diff line change @@ -60,9 +60,15 @@ describe('PaginationLink', () => {
6060 expect ( wrapper . find ( '.sr-only' ) . text ( ) ) . toBe ( 'Yo' ) ;
6161 } ) ;
6262
63- it ( 'should render custom caret' , ( ) => {
63+ it ( 'should render custom caret specified as a string ' , ( ) => {
6464 const wrapper = shallow ( < PaginationLink next > Yo</ PaginationLink > ) ;
6565
6666 expect ( wrapper . find ( { 'aria-hidden' : 'true' } ) . text ( ) ) . toBe ( 'Yo' ) ;
6767 } ) ;
68+
69+ it ( 'should render custom caret specified as a component' , ( ) => {
70+ const wrapper = shallow ( < PaginationLink next > < span > Yo</ span > </ PaginationLink > ) ;
71+
72+ expect ( wrapper . find ( { 'aria-hidden' : 'true' } ) . text ( ) ) . toBe ( 'Yo' ) ;
73+ } ) ;
6874} ) ;
You can’t perform that action at this time.
0 commit comments