@@ -288,16 +288,35 @@ it('clicking on name in the header should sort data according to names in descen
288288 ...data ,
289289 {
290290 id : '5' ,
291- name : 'Jamie Dimon' ,
291+ name : {
292+ raw : 'Iron Manuel' ,
293+ content : < span > Iron Manuel</ span > ,
294+ } ,
295+ rank : '6' ,
296+ mentions : '34' ,
297+ kol_score : '0.00%' ,
298+ reach : '0.00%' ,
299+ score : 300 ,
300+ } ,
301+ {
302+ id : '6' ,
303+ name : {
304+ raw : 'Jamie Dimon' ,
305+ content : < span > Jamie Dimon</ span > ,
306+ } ,
292307 rank : '5' ,
293308 mentions : '35' ,
294309 kol_score : '99.10%' ,
295310 reach : '99.10%' ,
296311 score : 250 ,
297312 } ,
313+
298314 {
299- id : '6' ,
300- name : 'Agustín Carstens' ,
315+ id : '7' ,
316+ name : {
317+ raw : 'Agustín Carstens' ,
318+ content : < span > Agustín Carstens</ span > ,
319+ } ,
301320 rank : '6' ,
302321 mentions : '34' ,
303322 kol_score : '0.00%' ,
@@ -316,6 +335,7 @@ it('clicking on name in the header should sort data according to names in descen
316335 expect ( wrapper . find ( 'Row' ) . map ( node => node . text ( ) ) ) . toMatchInlineSnapshot ( `
317336Array [
318337 "Jamie Dimon53599.10%99.10%angle_down",
338+ "Iron Manuel6340.00%0.00%angle_down",
319339 "Iron Man1993.70%93.60%angle_down",
320340 "Captain America23899.70%99.45%angle_down",
321341 "Agustín Carstens6340.00%0.00%angle_down",
@@ -502,3 +522,29 @@ it('checks for tooltip presence', () => {
502522 infoIcon . find ( 'button' ) . simulate ( 'mouseenter' ) ;
503523 expect ( open ) . toHaveBeenCalled ( ) ;
504524} ) ;
525+
526+ it ( 'content should be rendered when provided' , ( ) => {
527+ const wrapper = mount (
528+ < ExpandableTable
529+ maxBodyHeight = { 300 }
530+ renderRow = { props => < ExampleExtendedComponent { ...props } /> }
531+ columns = { columns }
532+ data = { [
533+ ...data ,
534+ {
535+ id : '2' ,
536+ name : {
537+ raw : 'Hulk' ,
538+ content : < span data-context = "hulk" > Hulk</ span > ,
539+ } ,
540+ rank : '2' ,
541+ mentions : '38' ,
542+ kol_score : '99.70%' ,
543+ reach : '99.45%' ,
544+ } ,
545+ ] }
546+ />
547+ ) ;
548+
549+ expect ( wrapper . find ( '[data-context="hulk"]' ) . exists ( ) ) . toBe ( true ) ;
550+ } ) ;
0 commit comments