chore: add test

pull/5007/head
bluwy 1 month ago
parent ce76f3ba83
commit 649828f0bf

@ -120,6 +120,12 @@ const line1 = 'This is line 1'
const line2 = 'This is line 2'
```
## Title Bar
```js [main.js]
console.log('Hello, VitePress!')
```
## Import Code Snippets
### Basic Code Snippet

@ -84,6 +84,7 @@ describe('Table of Contents', () => {
"Multiple single lines, ranges",
"Comment Highlight",
"Line Numbers",
"Title Bar",
"Import Code Snippets",
"Basic Code Snippet",
"Specify Region",
@ -213,6 +214,16 @@ describe('Line Numbers', () => {
})
})
describe('Title bar', () => {
test('render title bar', async () => {
const div = page.locator('#title-bar + div')
const titleBar = div.locator('.title-bar')
expect(titleBar).toBeTruthy()
const titleText = titleBar.locator('.title-text')
expect(await titleText.textContent()).toBe('main.js')
})
})
describe('Import Code Snippets', () => {
test('basic', async () => {
const lines = page.locator('#basic-code-snippet + div code > span')

Loading…
Cancel
Save