Skip to content

Commit 5e4c790

Browse files
committed
Verify sidebar links use file hosting
1 parent f39e07c commit 5e4c790

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

test/e2e/index-file.test.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
const docsifyInit = require('../helpers/docsify-init');
22

33
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#/`,
69
};
710

811
test('should serve from index file', async () => {
9-
await docsifyInit({
10-
config: sharedConfig,
11-
});
12+
await docsifyInit(sharedOptions);
1213

1314
await expect(page).toHaveText(
1415
'#main',
1516
'A magical documentation site generator'
1617
);
18+
expect(page.url()).toMatch(/index\.html#\/$/);
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(/index\.html#\/quickstart$/);
1727
});
1828
});

0 commit comments

Comments
 (0)