@@ -3,7 +3,6 @@ import { resolvePagePermalink } from '@vuepress/core'
3
3
describe ( 'core > page > resolvePagePermalink' , ( ) => {
4
4
it ( 'should return null' , ( ) => {
5
5
const resolved = resolvePagePermalink ( {
6
- options : { } ,
7
6
frontmatter : { } ,
8
7
slug : '' ,
9
8
date : '' ,
@@ -17,7 +16,6 @@ describe('core > page > resolvePagePermalink', () => {
17
16
describe ( 'use permalink or pattern' , ( ) => {
18
17
it ( 'should use permalink in frontmatter' , ( ) => {
19
18
const resolved = resolvePagePermalink ( {
20
- options : { } ,
21
19
frontmatter : {
22
20
permalink : '/frontmatter' ,
23
21
} ,
@@ -30,24 +28,8 @@ describe('core > page > resolvePagePermalink', () => {
30
28
expect ( resolved ) . toBe ( '/frontmatter' )
31
29
} )
32
30
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
-
48
31
it ( 'should use permalinkPattern in frontmatter' , ( ) => {
49
32
const resolved = resolvePagePermalink ( {
50
- options : { } ,
51
33
frontmatter : {
52
34
permalinkPattern : '/:year/:month/:day/:slug/frontmatter' ,
53
35
} ,
@@ -59,30 +41,14 @@ describe('core > page > resolvePagePermalink', () => {
59
41
60
42
expect ( resolved ) . toBe ( '/2020/10/07/foo-bar/frontmatter' )
61
43
} )
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
- } )
77
44
} )
78
45
79
46
describe ( 'permalink pattern' , ( ) => {
80
47
it ( 'should replace :raw with empty string 1' , ( ) => {
81
48
const resolved = resolvePagePermalink ( {
82
- options : {
49
+ frontmatter : {
83
50
permalinkPattern : '/:year/:month/:day/:slug/:raw' ,
84
51
} ,
85
- frontmatter : { } ,
86
52
slug : 'foo-bar' ,
87
53
date : '2020-10-07' ,
88
54
pathInferred : null ,
@@ -94,10 +60,9 @@ describe('core > page > resolvePagePermalink', () => {
94
60
95
61
it ( 'should replace :raw with empty string 2' , ( ) => {
96
62
const resolved = resolvePagePermalink ( {
97
- options : {
63
+ frontmatter : {
98
64
permalinkPattern : '/:year/:month/:day/:slug/:raw' ,
99
65
} ,
100
- frontmatter : { } ,
101
66
slug : 'foo-bar' ,
102
67
date : '2020-10-07' ,
103
68
pathInferred : '' ,
@@ -109,10 +74,9 @@ describe('core > page > resolvePagePermalink', () => {
109
74
110
75
it ( 'should replace :raw with empty string 3' , ( ) => {
111
76
const resolved = resolvePagePermalink ( {
112
- options : {
77
+ frontmatter : {
113
78
permalinkPattern : '/:year/:month/:day/:slug/:raw' ,
114
79
} ,
115
- frontmatter : { } ,
116
80
slug : 'foo-bar' ,
117
81
date : '2020-10-07' ,
118
82
pathInferred : '/' ,
@@ -124,10 +88,9 @@ describe('core > page > resolvePagePermalink', () => {
124
88
125
89
it ( 'should prefix with locale path' , ( ) => {
126
90
const resolved = resolvePagePermalink ( {
127
- options : {
91
+ frontmatter : {
128
92
permalinkPattern : '/:year/:month/:day/:slug/:raw' ,
129
93
} ,
130
- frontmatter : { } ,
131
94
slug : 'foo-bar' ,
132
95
date : '2020-10-07' ,
133
96
pathInferred : '/raw.html' ,
0 commit comments