Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ee550d0

Browse files
sy-recordsjhildenbiddle
andauthored
fix: search on homepage test (#1398)
* fix: ci build * reset * test * update * fix test * fix * Add multi-page search test * rename Co-authored-by: John Hildenbiddle <jhildenbiddle@users.noreply.github.com>
1 parent c9d4f7a commit ee550d0

File tree

2 files changed

+38
-16
lines changed

2 files changed

+38
-16
lines changed

‎test/e2e/search.test.js‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
});

‎test/e2e/sidebar.test.js‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /