Skip to content

Commit 7a2d1bf

Browse files
committed
test: should be able add a page with explicit content
1 parent 698806f commit 7a2d1bf

File tree

1 file changed

+10
-1
lines changed
  • packages/@vuepress/core/lib/node/__tests__/prepare

1 file changed

+10
-1
lines changed

packages/@vuepress/core/lib/node/__tests__/prepare/Page.spec.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ describe('markdown page', () => {
100100
expect(page._strippedContent).toBe(content)
101101
})
102102

103+
test('should be able add a page with explicit content', async () => {
104+
const { filePath } = getDocument('README.md')
105+
const content = await readFile(filePath)
106+
const markdown = getMarkdown()
107+
const page = await setupPage({ content }, { markdown })
108+
109+
expect(page._content).toBe(content)
110+
expect(page._strippedContent).toBe(content)
111+
})
112+
103113
test('should work with frontmatter when pointing to a markdown file', async () => {
104114
const { relative, filePath } = getDocument('alpha.md')
105115
const title = 'VuePress Alpha' // from fixture
@@ -274,6 +284,5 @@ describe('public api', () => {
274284

275285
// TODO permalink - driven by global pattern
276286
// TODO I18n
277-
// TODO Add a page with explicit content
278287
// TODO SFC
279288

0 commit comments

Comments
 (0)