Skip to content

Commit

Permalink
fix: search on homepage test (docsifyjs#1398)
Browse files Browse the repository at this point in the history
* 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
sy-records and jhildenbiddle committed Oct 15, 2020
1 parent a706e57 commit 2620359
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 39 deletions.
40 changes: 40 additions & 0 deletions test/e2e/search.test.js
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');
});


});
39 changes: 0 additions & 39 deletions test/e2e/sidebar.test.js

This file was deleted.

0 comments on commit 2620359

Please sign in to comment.