mirror of https://github.com/vuejs/vitepress
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
2 years ago
|
import { expect, test } from 'vitest'
|
||
|
import { page, vitePressTestUrl, waitForLayout } from '~utils'
|
||
|
|
||
|
describe('test multi sidebar sort root', () => {
|
||
|
beforeAll(async () => {
|
||
|
await page.goto(
|
||
|
vitePressTestUrl + '/frontmatter/multiple-levels-outline.html'
|
||
|
)
|
||
|
await waitForLayout()
|
||
|
})
|
||
|
|
||
|
test('using / sidebar', async () => {
|
||
|
const sidebarLocator = await page.locator(
|
||
|
'.VPSidebarGroup .title .title-text'
|
||
|
)
|
||
|
|
||
|
const sidebarContent = await sidebarLocator.allTextContents()
|
||
|
expect(sidebarContent).toEqual([
|
||
|
'Frontmatter',
|
||
|
'Static Data',
|
||
|
'Multi Sidebar Test'
|
||
|
])
|
||
|
})
|
||
|
})
|
||
|
|
||
|
describe('test multi sidebar sort other', () => {
|
||
|
beforeAll(async () => {
|
||
|
await page.goto(vitePressTestUrl + '/multi-sidebar/index.html')
|
||
|
await waitForLayout()
|
||
|
})
|
||
|
|
||
|
test('using /multi-sidebar/ sidebar', async () => {
|
||
|
const sidebarLocator = await page.locator(
|
||
|
'.VPSidebarGroup .title .title-text'
|
||
|
)
|
||
|
|
||
|
const sidebarContent = await sidebarLocator.allTextContents()
|
||
|
expect(sidebarContent).toEqual(['Multi Sidebar'])
|
||
|
})
|
||
|
})
|