Skip to content

Commit

Permalink
fix: search on homepage test (#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 <jhildenbiddle@users.noreply.github.com>
  • Loading branch information
sy-records and jhildenbiddle authored Oct 15, 2020
1 parent c9d4f7a commit ee550d0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
38 changes: 38 additions & 0 deletions test/e2e/search.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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');
});
});
16 changes: 0 additions & 16 deletions test/e2e/sidebar.test.js

This file was deleted.

1 comment on commit ee550d0

@vercel
Copy link

@vercel vercel bot commented on ee550d0 Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.