-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathembed-files.test.js
More file actions
33 lines (28 loc) · 846 Bytes
/
embed-files.test.js
File metadata and controls
33 lines (28 loc) · 846 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
29
30
31
32
33
import docsifyInit from '../helpers/docsify-init.js';
import { test, expect } from './fixtures/docsify-init-fixture.js';
test.describe('Embed files', () => {
const routes = {
'fragment.md': '## Fragment',
};
test('embed into homepage', async ({ page }) => {
await docsifyInit({
routes,
markdown: {
homepage: "# Hello World\n\n[fragment](fragment.md ':include')",
},
// _logHTML: {},
});
await expect(page.locator('#main')).toContainText('Fragment');
});
test('embed into cover', async ({ page }) => {
await docsifyInit({
routes,
markdown: {
homepage: '# Hello World',
coverpage: "# Cover\n\n[fragment](fragment.md ':include')",
},
// _logHTML: {},
});
await expect(page.locator('.cover-main')).toContainText('Fragment');
});
});