File tree 1 file changed +15
-5
lines changed 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
const docsifyInit = require ( '../helpers/docsify-init' ) ;
2
2
3
3
describe ( `Index file hosting` , function ( ) {
4
- const sharedConfig = {
5
- basePath : `${ TEST_HOST } /docs/index.html#/` ,
4
+ const sharedOptions = {
5
+ config : {
6
+ basePath : `${ TEST_HOST } /docs/index.html#/` ,
7
+ } ,
8
+ testURL : `${ TEST_HOST } /docs/index.html#/` ,
6
9
} ;
7
10
8
11
test ( 'should serve from index file' , async ( ) => {
9
- await docsifyInit ( {
10
- config : sharedConfig ,
11
- } ) ;
12
+ await docsifyInit ( sharedOptions ) ;
12
13
13
14
await expect ( page ) . toHaveText (
14
15
'#main' ,
15
16
'A magical documentation site generator'
16
17
) ;
18
+ expect ( page . url ( ) ) . toMatch ( / i n d e x \. h t m l # \/ $ / ) ;
19
+ } ) ;
20
+
21
+ test ( 'should use index file links in sidebar from index file hosting' , async ( ) => {
22
+ await docsifyInit ( sharedOptions ) ;
23
+
24
+ await page . click ( 'a[href="#/quickstart"]' ) ;
25
+ await expect ( page ) . toHaveText ( '#main' , 'Quick start' ) ;
26
+ expect ( page . url ( ) ) . toMatch ( / i n d e x \. h t m l # \/ q u i c k s t a r t $ / ) ;
17
27
} ) ;
18
28
} ) ;
You can’t perform that action at this time.
0 commit comments