File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
packages/@vuepress/core/lib/node/__tests__/prepare Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,21 @@ describe('permalink', () => {
81
81
expect ( page . path ) . toBe ( '/permalink/' )
82
82
expect ( page . regularPath ) . toBe ( '/' )
83
83
} )
84
+
85
+ test ( 'should be able to set permalink from global pattern' , async ( ) => {
86
+ const permalinkPattern = '/:year/:month/:day/:slug'
87
+ const { relative, filePath } = getDocument ( '2020-01-01-date.md' )
88
+ const markdown = getMarkdown ( )
89
+ const page = await setupPage ( { filePath, relative, permalinkPattern } , { markdown } )
90
+ expect ( page . path ) . toBe ( '/2020/01/01/date/' )
91
+ expect ( page . regularPath ) . toBe ( '/2020-01-01-date.html' )
92
+
93
+ const pageWithLocalePath = await setupPage (
94
+ { filePath, relative, permalinkPattern } ,
95
+ { computed : { setPage ( ) { } , $localePath : '/zh/' } , markdown }
96
+ )
97
+ expect ( pageWithLocalePath . path ) . toBe ( '/zh/2020/01/01/date/' )
98
+ } )
84
99
} )
85
100
86
101
describe ( 'markdown page' , ( ) => {
@@ -282,7 +297,3 @@ describe('public api', () => {
282
297
} )
283
298
} )
284
299
285
- // TODO permalink - driven by global pattern
286
- // TODO I18n
287
- // TODO SFC
288
-
You can’t perform that action at this time.
0 commit comments