mirror of
https://github.com/docsifyjs/docsify.git
synced 2026-10-18 13:11:11 +08:00
ee550d0c51
* 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>
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
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');
|
|
});
|
|
});
|