Remove support for miniTocMaxHeadingLevel (#34758)
This commit is contained in:
@@ -328,47 +328,6 @@ describe('server', () => {
|
||||
expect($('a[href="/en/authentication/keeping-your-account-and-data-secure"]')).toHaveLength(1)
|
||||
})
|
||||
|
||||
describe('autogenerated mini TOCs', () => {
|
||||
// TODO disable the mini TOC tests when we replace it with sticky TOC header
|
||||
test('renders mini TOC in articles with more than one heading', async () => {
|
||||
const $ = await getDOM('/en/github/getting-started-with-github/githubs-products')
|
||||
expect($('h2#in-this-article').length).toBe(1)
|
||||
expect($('h2#in-this-article + nav ul li').length).toBeGreaterThan(1)
|
||||
})
|
||||
|
||||
test('renders mini TOC in articles that includes h3s when specified by frontmatter', async () => {
|
||||
const $ = await getDOM(
|
||||
'/en/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-security-settings-in-your-enterprise'
|
||||
)
|
||||
expect($('h2#in-this-article').length).toBe(1)
|
||||
expect($('h2#in-this-article + nav ul').length).toBeGreaterThan(0) // non-indented items
|
||||
expect($('h2#in-this-article + nav ul div ul div').length).toBeGreaterThan(0) // indented items
|
||||
})
|
||||
|
||||
test('does not render mini TOC in articles with only one heading', async () => {
|
||||
const $ = await getDOM(
|
||||
'/en/github/visualizing-repository-data-with-graphs/about-repository-graphs'
|
||||
)
|
||||
expect($('h2#in-this-article').length).toBe(0)
|
||||
})
|
||||
|
||||
test('does not render mini TOC in articles with no headings', async () => {
|
||||
const $ = await getDOM('/en/github/authenticating-to-github/reviewing-your-deploy-keys')
|
||||
expect($('h2#in-this-article').length).toBe(0)
|
||||
})
|
||||
|
||||
test('does not render mini TOC in non-articles', async () => {
|
||||
const $ = await getDOM('/github/getting-started-with-github')
|
||||
expect($('h2#in-this-article').length).toBe(0)
|
||||
})
|
||||
|
||||
// TODO
|
||||
test('renders mini TOC with correct links when headings contain markup', async () => {
|
||||
const $ = await getDOM('/en/actions/using-workflows/workflow-syntax-for-github-actions')
|
||||
expect($('h2#in-this-article + nav ul li a[href="#on"]').length).toBe(1)
|
||||
})
|
||||
})
|
||||
|
||||
describe('image asset paths', () => {
|
||||
const localImageCacheBustBasePathRegex = /^\/assets\/cb-\d+\/images\//
|
||||
const localImageBasePath = '/assets/images'
|
||||
|
||||
Reference in New Issue
Block a user