@@ -3,7 +3,6 @@ import { resolvePagePermalink } from '@vuepress/core'
33describe ( 'core > page > resolvePagePermalink' , ( ) => {
44 it ( 'should return null' , ( ) => {
55 const resolved = resolvePagePermalink ( {
6- options : { } ,
76 frontmatter : { } ,
87 slug : '' ,
98 date : '' ,
@@ -17,7 +16,6 @@ describe('core > page > resolvePagePermalink', () => {
1716 describe ( 'use permalink or pattern' , ( ) => {
1817 it ( 'should use permalink in frontmatter' , ( ) => {
1918 const resolved = resolvePagePermalink ( {
20- options : { } ,
2119 frontmatter : {
2220 permalink : '/frontmatter' ,
2321 } ,
@@ -30,24 +28,8 @@ describe('core > page > resolvePagePermalink', () => {
3028 expect ( resolved ) . toBe ( '/frontmatter' )
3129 } )
3230
33- it ( 'should use permalink in options' , ( ) => {
34- const resolved = resolvePagePermalink ( {
35- options : {
36- permalink : '/options' ,
37- } ,
38- frontmatter : { } ,
39- slug : '' ,
40- date : '' ,
41- pathInferred : null ,
42- pathLocale : '' ,
43- } )
44-
45- expect ( resolved ) . toBe ( '/options' )
46- } )
47-
4831 it ( 'should use permalinkPattern in frontmatter' , ( ) => {
4932 const resolved = resolvePagePermalink ( {
50- options : { } ,
5133 frontmatter : {
5234 permalinkPattern : '/:year/:month/:day/:slug/frontmatter' ,
5335 } ,
@@ -59,30 +41,14 @@ describe('core > page > resolvePagePermalink', () => {
5941
6042 expect ( resolved ) . toBe ( '/2020/10/07/foo-bar/frontmatter' )
6143 } )
62-
63- it ( 'should use permalinkPattern in options' , ( ) => {
64- const resolved = resolvePagePermalink ( {
65- options : {
66- permalinkPattern : '/:year/:month/:day/:slug/options' ,
67- } ,
68- frontmatter : { } ,
69- slug : 'foo-bar' ,
70- date : '2020-10-07' ,
71- pathInferred : null ,
72- pathLocale : '' ,
73- } )
74-
75- expect ( resolved ) . toBe ( '/2020/10/07/foo-bar/options' )
76- } )
7744 } )
7845
7946 describe ( 'permalink pattern' , ( ) => {
8047 it ( 'should replace :raw with empty string 1' , ( ) => {
8148 const resolved = resolvePagePermalink ( {
82- options : {
49+ frontmatter : {
8350 permalinkPattern : '/:year/:month/:day/:slug/:raw' ,
8451 } ,
85- frontmatter : { } ,
8652 slug : 'foo-bar' ,
8753 date : '2020-10-07' ,
8854 pathInferred : null ,
@@ -94,10 +60,9 @@ describe('core > page > resolvePagePermalink', () => {
9460
9561 it ( 'should replace :raw with empty string 2' , ( ) => {
9662 const resolved = resolvePagePermalink ( {
97- options : {
63+ frontmatter : {
9864 permalinkPattern : '/:year/:month/:day/:slug/:raw' ,
9965 } ,
100- frontmatter : { } ,
10166 slug : 'foo-bar' ,
10267 date : '2020-10-07' ,
10368 pathInferred : '' ,
@@ -109,10 +74,9 @@ describe('core > page > resolvePagePermalink', () => {
10974
11075 it ( 'should replace :raw with empty string 3' , ( ) => {
11176 const resolved = resolvePagePermalink ( {
112- options : {
77+ frontmatter : {
11378 permalinkPattern : '/:year/:month/:day/:slug/:raw' ,
11479 } ,
115- frontmatter : { } ,
11680 slug : 'foo-bar' ,
11781 date : '2020-10-07' ,
11882 pathInferred : '/' ,
@@ -124,10 +88,9 @@ describe('core > page > resolvePagePermalink', () => {
12488
12589 it ( 'should prefix with locale path' , ( ) => {
12690 const resolved = resolvePagePermalink ( {
127- options : {
91+ frontmatter : {
12892 permalinkPattern : '/:year/:month/:day/:slug/:raw' ,
12993 } ,
130- frontmatter : { } ,
13194 slug : 'foo-bar' ,
13295 date : '2020-10-07' ,
13396 pathInferred : '/raw.html' ,
0 commit comments