@@ -37,7 +37,7 @@ describe('The `footnoteref` paired shortcode', () => {
3737describe ( 'The `footnotes` shortcode' , ( ) => {
3838 const { footnoteref, footnotes } = plugin ( config , {
3939 titleId : 'footnotes-title-id' ,
40- title : 'Footnote references'
40+ title : 'Footnote references' ,
4141 } )
4242 const context = { page : { inputPath : 'tests/footnotes' } }
4343 const root = document . createElement ( 'div' )
@@ -84,6 +84,7 @@ describe('The `footnotes` shortcode', () => {
8484 expect ( listItem ) . not . toBeUndefined ( )
8585 expect ( listItem . getAttribute ( 'class' ) ) . toBe ( 'Footnotes__list-item' )
8686 expect ( listItem . getAttribute ( 'id' ) ) . toBe ( 'foo-id-note' )
87+ expect ( listItem . getAttribute ( 'role' ) ) . toBe ( 'doc-endnote' )
8788 expect ( listItem . textContent ) . toBe ( 'foo-footnote ↩' )
8889 } )
8990
@@ -132,16 +133,21 @@ describe('The `eleventy-plugin-footnotes` plugin', () => {
132133 expect ( root . querySelector ( 'footer' ) . getAttribute ( 'class' ) ) . toBe ( 'Kitty' )
133134 expect ( root . querySelector ( 'h2' ) . getAttribute ( 'class' ) ) . toBe ( 'Kitty__title' )
134135 expect ( root . querySelector ( 'ol' ) . getAttribute ( 'class' ) ) . toBe ( 'Kitty__list' )
135- expect ( root . querySelector ( 'li' ) . getAttribute ( 'class' ) ) . toBe ( 'Kitty__list-item' )
136- expect ( root . querySelector ( 'li a' ) . getAttribute ( 'class' ) ) . toBe ( 'Kitty__back-link' )
136+ expect ( root . querySelector ( 'li' ) . getAttribute ( 'class' ) ) . toBe (
137+ 'Kitty__list-item'
138+ )
139+ expect ( root . querySelector ( 'li a' ) . getAttribute ( 'class' ) ) . toBe (
140+ 'Kitty__back-link'
141+ )
137142 } )
138143
139144 it ( 'should allow customising the back link label' , ( ) => {
140- const { footnotes } = plugin ( config , { backLinkLabel : ( _ , i ) => 'Go to ' + ( i + 1 ) } )
145+ const { footnotes } = plugin ( config , {
146+ backLinkLabel : ( _ , i ) => 'Go to ' + ( i + 1 ) ,
147+ } )
141148 const root = document . createElement ( 'div' )
142149 root . innerHTML = footnotes . call ( context )
143150
144151 expect ( root . querySelector ( 'a' ) . getAttribute ( 'aria-label' ) ) . toBe ( 'Go to 1' )
145-
146152 } )
147153} )
0 commit comments