File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ describe('Search Plugin Tests', function() {
14
14
This is the homepage.
15
15
` ,
16
16
sidebar : `
17
- - [Home page](/)
18
17
- [Test Page](test)
19
18
` ,
20
19
} ,
@@ -73,4 +72,38 @@ describe('Search Plugin Tests', function() {
73
72
await page . fill ( 'input[type=search]' , 'repository2' ) ;
74
73
await expect ( page ) . toEqualText ( '.results-panel h2' , 'GitHub Pages ignore2' ) ;
75
74
} ) ;
75
+
76
+ test ( 'search only one homepage' , async ( ) => {
77
+ const docsifyInitConfig = {
78
+ markdown : {
79
+ sidebar : `
80
+ - [README](README)
81
+ - [Test Page](test)
82
+ ` ,
83
+ } ,
84
+ routes : {
85
+ '/README.md' : `
86
+ # Hello World
87
+
88
+ This is the homepage.
89
+ ` ,
90
+ '/test.md' : `
91
+ # Test Page
92
+
93
+ This is a custom route.
94
+ ` ,
95
+ } ,
96
+ scriptURLs : [ '/lib/plugins/search.js' ] ,
97
+ } ;
98
+
99
+ await docsifyInit ( docsifyInitConfig ) ;
100
+ await page . fill ( 'input[type=search]' , 'hello' ) ;
101
+ await expect ( page ) . toEqualText ( '.results-panel h2' , 'Hello World' ) ;
102
+ // error
103
+ await expect ( page ) . toEqualText ( '.results-panel' , 'Hello World' ) ;
104
+
105
+ await page . click ( '.clear-button' ) ;
106
+ await page . fill ( 'input[type=search]' , 'test' ) ;
107
+ await expect ( page ) . toEqualText ( '.results-panel h2' , 'Test Page' ) ;
108
+ } ) ;
76
109
} ) ;
You can’t perform that action at this time.
0 commit comments