forked from docsifyjs/docsify
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
a706e57
commit 2620359
Showing
2 changed files
with
40 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const docsifyInit = require('../helpers/docsify-init'); | ||
|
||
// Suite | ||
// ----------------------------------------------------------------------------- | ||
describe('Search Plugin Tests', function() { | ||
// Tests | ||
// --------------------------------------------------------------------------- | ||
test('search readme', async () => { | ||
const docsifyInitConfig = { | ||
markdown: { | ||
homepage: ` | ||
# Hello World | ||
This is the homepage. | ||
`, | ||
sidebar: ` | ||
- [Home page](/) | ||
- [Test Page](test) | ||
`, | ||
}, | ||
routes: { | ||
'/test.md': ` | ||
# Test Page | ||
This is a custom route. | ||
`, | ||
}, | ||
scriptURLs: ['/lib/plugins/search.min.js'], | ||
}; | ||
|
||
await docsifyInit(docsifyInitConfig); | ||
await page.fill('input[type=search]', 'hello'); | ||
await expect(page).toEqualText('.results-panel h2', 'Hello World'); | ||
await page.click('.clear-button'); | ||
await page.fill('input[type=search]', 'test'); | ||
await expect(page).toEqualText('.results-panel h2', 'Test Page'); | ||
}); | ||
|
||
|
||
}); |
This file was deleted.
Oops, something went wrong.