Skip to content

Commit 2620359

Browse files
fix: search on homepage test (docsifyjs#1398)
* fix: ci build * reset * test * update * fix test * fix * Add multi-page search test * rename Co-authored-by: John Hildenbiddle <[email protected]>
1 parent a706e57 commit 2620359

File tree

2 files changed

+40
-39
lines changed

2 files changed

+40
-39
lines changed

test/e2e/search.test.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const docsifyInit = require('../helpers/docsify-init');
2+
3+
// Suite
4+
// -----------------------------------------------------------------------------
5+
describe('Search Plugin Tests', function() {
6+
// Tests
7+
// ---------------------------------------------------------------------------
8+
test('search readme', async () => {
9+
const docsifyInitConfig = {
10+
markdown: {
11+
homepage: `
12+
# Hello World
13+
14+
This is the homepage.
15+
`,
16+
sidebar: `
17+
- [Home page](/)
18+
- [Test Page](test)
19+
`,
20+
},
21+
routes: {
22+
'/test.md': `
23+
# Test Page
24+
25+
This is a custom route.
26+
`,
27+
},
28+
scriptURLs: ['/lib/plugins/search.min.js'],
29+
};
30+
31+
await docsifyInit(docsifyInitConfig);
32+
await page.fill('input[type=search]', 'hello');
33+
await expect(page).toEqualText('.results-panel h2', 'Hello World');
34+
await page.click('.clear-button');
35+
await page.fill('input[type=search]', 'test');
36+
await expect(page).toEqualText('.results-panel h2', 'Test Page');
37+
});
38+
39+
40+
});

test/e2e/sidebar.test.js

-39
This file was deleted.

0 commit comments

Comments
 (0)