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.
36 lines
982 B
36 lines
982 B
2 years ago
|
describe('render correct content', async () => {
|
||
2 years ago
|
beforeAll(async () => {
|
||
2 years ago
|
await goto('/')
|
||
2 years ago
|
})
|
||
|
|
||
|
test('main content', async () => {
|
||
2 years ago
|
const h1Locator = page.locator('.VPContent h1')
|
||
|
const h2Locator = page.locator('.VPContent h2')
|
||
|
const pLocator = page.locator('.VPContent p')
|
||
2 years ago
|
|
||
2 years ago
|
const [h1Contents, h2Contents, pContents] = await Promise.all([
|
||
2 years ago
|
h1Locator.allTextContents(),
|
||
|
h2Locator.allTextContents(),
|
||
|
pLocator.allTextContents()
|
||
|
])
|
||
|
|
||
|
expect(h1Contents).toEqual(['Lorem Ipsum #'])
|
||
2 years ago
|
expect(h2Contents).toEqual([
|
||
2 years ago
|
'What is Lorem Ipsum? #',
|
||
|
'Where does it come from? #',
|
||
|
'Why do we use it? #',
|
||
|
'Where can I get some? #'
|
||
|
])
|
||
|
expect(pContents).toMatchSnapshot()
|
||
|
})
|
||
|
|
||
|
test('outline', async () => {
|
||
2 years ago
|
const outlineLinksLocator = page.locator(
|
||
2 years ago
|
'.VPDocAsideOutline .root .outline-link'
|
||
|
)
|
||
|
|
||
|
const outlineLinksCount = await outlineLinksLocator.count()
|
||
2 years ago
|
expect(outlineLinksCount).toEqual(4)
|
||
2 years ago
|
})
|
||
|
})
|