1
0
mirror of synced 2025-12-23 11:54:18 -05:00

Remove support for miniTocMaxHeadingLevel (#34758)

This commit is contained in:
Hector Alfaro
2023-02-17 11:29:02 -05:00
committed by GitHub
parent 7800cfa2fc
commit 4cd28fd735
346 changed files with 146 additions and 428 deletions

View File

@@ -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'