forked from vuejs/vitepress
/
multisidebar.spec.ts
40 lines (34 loc) · 1.06 KB
/
multisidebar.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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'])
})
})