Skip to content

Commit f161d11

Browse files
committed
add test
1 parent 2620359 commit f161d11

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

test/e2e/sidebar.test.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const docsifyInit = require('../helpers/docsify-init');
2+
3+
// Suite
4+
// -----------------------------------------------------------------------------
5+
describe('Sidebar Tests', function() {
6+
// Tests
7+
// ---------------------------------------------------------------------------
8+
test('search readme', async () => {
9+
await docsifyInit();
10+
await page.goto(DOCS_URL + '/#/quickstart');
11+
await page.fill('input[type=search]', 'Please consider donating');
12+
expect(
13+
await page.innerText('.results-panel > .matching-post > a > h2')
14+
).toEqual('Donate');
15+
});
16+
17+
test('search ignore title', async () => {
18+
const docsifyInitConfig = {
19+
markdown: {
20+
homepage: `
21+
# Hello World
22+
23+
This is the homepage.
24+
25+
## Test ignore title <!-- {docsify-ignore} -->
26+
27+
This is the test ignore title.
28+
`,
29+
},
30+
scriptURLs: ['/lib/plugins/search.min.js'],
31+
styleURLs: ['/lib/themes/vue.css'],
32+
};
33+
await docsifyInit(docsifyInitConfig);
34+
await page.fill('input[type=search]', 'Test ignore title');
35+
expect(await page.innerText('.results-panel h2')).toEqual(
36+
'Test ignore title'
37+
);
38+
});
39+
});

0 commit comments

Comments
 (0)