forked from docsifyjs/docsify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-file.test.js
More file actions
28 lines (25 loc) 路 891 Bytes
/
Copy pathindex-file.test.js
File metadata and controls
28 lines (25 loc) 路 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const docsifyInit = require('../helpers/docsify-init');
const { test, expect } = require('./fixtures/docsify-init-fixture');
test.describe('Index file hosting', () => {
const sharedOptions = {
config: {
basePath: '/docs/index.html#/',
},
testURL: '/docs/index.html#/',
};
test('should serve from index file', async ({ page }) => {
await docsifyInit(sharedOptions);
await expect(page.locator('#main')).toContainText(
'A magical documentation site generator'
);
expect(page.url()).toMatch(/index\.html#\/$/);
});
test('should use index file links in sidebar from index file hosting', async ({
page,
}) => {
await docsifyInit(sharedOptions);
await page.click('a[href="#/quickstart"]');
await expect(page.locator('#main')).toContainText('Quick start');
expect(page.url()).toMatch(/index\.html#\/quickstart$/);
});
});