@@ -16,7 +16,7 @@ const glossaryTerms = [
1616 } ,
1717] ;
1818
19- describe . skip ( 'Table of Contents' , ( ) => {
19+ describe ( 'Table of Contents' , ( ) => {
2020 it ( 'should have a header' , ( ) => {
2121 const { container } = render (
2222 < TableOfContents >
@@ -27,7 +27,7 @@ describe.skip('Table of Contents', () => {
2727 expect ( container . querySelectorAll ( 'li' ) [ 0 ] ) . toHaveTextContent ( 'Table of Contents' ) ;
2828 } ) ;
2929
30- it ( 'generates TOC from headings' , ( ) => {
30+ it . skip ( 'generates TOC from headings' , ( ) => {
3131 const txt = '# Heading Zed\n\n# Heading One' ;
3232 const ast = reactProcessor ( ) . parse ( txt ) ;
3333 const toc = reactTOC ( ast ) ;
@@ -36,7 +36,7 @@ describe.skip('Table of Contents', () => {
3636 expect ( container . querySelectorAll ( 'li > a[href]:not([href="#"])' ) ) . toHaveLength ( 2 ) ;
3737 } ) ;
3838
39- it ( 'includes two heading levels' , ( ) => {
39+ it . skip ( 'includes two heading levels' , ( ) => {
4040 const txt = '# Heading Zed\n\n## Subheading One\n\n### Deep Heading Two' ;
4141 const ast = reactProcessor ( ) . parse ( txt ) ;
4242 const toc = reactTOC ( ast ) ;
@@ -46,7 +46,7 @@ describe.skip('Table of Contents', () => {
4646 expect ( container . innerHTML ) . toMatchSnapshot ( ) ;
4747 } ) ;
4848
49- it ( 'normalizes root depth level' , ( ) => {
49+ it . skip ( 'normalizes root depth level' , ( ) => {
5050 const txt = '##### Heading Zed\n\n###### Subheading Zed' ;
5151 const ast = reactProcessor ( ) . parse ( txt ) ;
5252 const toc = reactTOC ( ast ) ;
@@ -55,7 +55,7 @@ describe.skip('Table of Contents', () => {
5555 expect ( container . querySelectorAll ( 'li > a[href]:not([href="#"])' ) ) . toHaveLength ( 2 ) ;
5656 } ) ;
5757
58- it ( 'includes variables' , ( ) => {
58+ it . skip ( 'includes variables' , ( ) => {
5959 const txt = '# Heading <<test>>' ;
6060 const ast = reactProcessor ( ) . parse ( txt ) ;
6161 const toc = reactTOC ( ast ) ;
@@ -64,7 +64,7 @@ describe.skip('Table of Contents', () => {
6464 expect ( container . querySelector ( 'li > a[href]:not([href="#"])' ) ) . toHaveTextContent ( `Heading ${ variables . user . test } ` ) ;
6565 } ) ;
6666
67- it ( 'includes glossary items' , ( ) => {
67+ it . skip ( 'includes glossary items' , ( ) => {
6868 const txt = '# Heading <<glossary:demo>>' ;
6969 const ast = reactProcessor ( ) . parse ( txt ) ;
7070 const toc = reactTOC ( ast ) ;
@@ -74,4 +74,14 @@ describe.skip('Table of Contents', () => {
7474 `Heading ${ glossaryTerms [ 0 ] . term } ` ,
7575 ) ;
7676 } ) ;
77+
78+ it ( 'accepts custom heading' , ( ) => {
79+ const { container } = render (
80+ < TableOfContents heading = "Custom Heading" >
81+ < h1 > Heading 1</ h1 >
82+ </ TableOfContents > ,
83+ ) ;
84+
85+ expect ( container . querySelectorAll ( 'li' ) [ 0 ] ) . toHaveTextContent ( 'Custom Heading' ) ;
86+ } ) ;
7787} ) ;
0 commit comments