diff --git a/__tests__/e2e/markdown-extensions/index.md b/__tests__/e2e/markdown-extensions/index.md index 3446b4ef..252df395 100644 --- a/__tests__/e2e/markdown-extensions/index.md +++ b/__tests__/e2e/markdown-extensions/index.md @@ -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 diff --git a/__tests__/e2e/markdown-extensions/markdown-extensions.test.ts b/__tests__/e2e/markdown-extensions/markdown-extensions.test.ts index 839f953c..7e7e23cd 100644 --- a/__tests__/e2e/markdown-extensions/markdown-extensions.test.ts +++ b/__tests__/e2e/markdown-extensions/markdown-extensions.test.ts @@ -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')