11import { rehype } from 'rehype'
22import { describe , expect , test } from 'vitest'
3- import { rehypeCollapsableToc } from '../src'
3+ import { rehypeCollapsibleToc } from '../src'
44
5- describe ( 'rehypeCollapsableToc ' , ( ) => {
5+ describe ( 'rehypeCollapsibleToc ' , ( ) => {
66 test ( 'h2だけのとき、同じレベルで作成される' , async ( ) => {
77 const input = `
88 <h2 id="heading-1"><a href="#heading-1">Heading 1</a></h2>
99 <h2 id="heading-2"><a href="#heading-2">Heading 2</a></h2>
1010 <h2 id="heading-3"><a href="#heading-3">Heading 3</a></h2>
1111 `
12- const { value } = await rehype ( ) . use ( rehypeCollapsableToc ) . process ( input )
12+ const { value } = await rehype ( ) . use ( rehypeCollapsibleToc ) . process ( input )
1313 expect ( value ) . toMatchSnapshot ( )
1414 } )
1515 test ( 'h2以外で同じレベルの見出しが適切に作成される' , async ( ) => {
@@ -20,7 +20,7 @@ describe('rehypeCollapsableToc', () => {
2020 <h4 id="heading-1-2-1"><a href="#heading-1-2-1">Heading 1-2-1</a></h4>
2121 <h4 id="heading-1-2-2"><a href="#heading-1-2-2">Heading 1-2-2</a></h4>
2222 `
23- const { value } = await rehype ( ) . use ( rehypeCollapsableToc ) . process ( input )
23+ const { value } = await rehype ( ) . use ( rehypeCollapsibleToc ) . process ( input )
2424 expect ( value ) . toMatchSnapshot ( )
2525 } )
2626 test ( '低いレベルの見出しに戻るときにも適切に作成される' , async ( ) => {
@@ -32,7 +32,7 @@ describe('rehypeCollapsableToc', () => {
3232 <h4 id="heading-2-1"><a href="#heading-2-1">Heading 2-1</a></h4>
3333 <h2 id="heading-3"><a href="#heading-3">Heading 3</a></h2>
3434 `
35- const { value } = await rehype ( ) . use ( rehypeCollapsableToc ) . process ( input )
35+ const { value } = await rehype ( ) . use ( rehypeCollapsibleToc ) . process ( input )
3636 expect ( value ) . toMatchSnapshot ( )
3737 } )
3838} )
0 commit comments