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.
vitepress/examples/configured/__test__/multisidebar.spec.ts

42 lines
1.1 KiB

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',
'& <Text Literals &> code',
'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'])
})
})