Skip to content

Commit

Permalink
Add multi-page search test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhildenbiddle authored Oct 15, 2020
1 parent a5409ec commit ce6c555
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions test/e2e/sidebar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,26 @@ describe('Sidebar Tests', function() {
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'],
styleURLs: ['/lib/themes/vue.css'],
};

await docsifyInit(docsifyInitConfig);
await page.fill('input[type=search]', 'Hello');
expect(await page.innerText('.results-panel h2')).toEqual('Hello World');
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');
});
});

0 comments on commit ce6c555

Please sign in to comment.