diff --git a/test/e2e/search.test.js b/test/e2e/search.test.js index 42a3cca2f3..034e0c2b86 100644 --- a/test/e2e/search.test.js +++ b/test/e2e/search.test.js @@ -36,5 +36,26 @@ describe('Search Plugin Tests', function() { await expect(page).toEqualText('.results-panel h2', 'Test Page'); }); + test('search ignore title', async () => { + const docsifyInitConfig = { + markdown: { + homepage: ` + # Hello World + + This is the homepage. + + ## Test ignore title + This is the test ignore title. + `, + }, + scriptURLs: ['/lib/plugins/search.min.js'], + styleURLs: ['/lib/themes/vue.css'], + }; + await docsifyInit(docsifyInitConfig); + await page.fill('input[type=search]', 'Test ignore title'); + expect(await page.innerText('.results-panel h2')).toEqual( + 'Test ignore title' + ); + }); }); diff --git a/test/e2e/sidebar.test.js b/test/e2e/sidebar.test.js deleted file mode 100644 index 5288dfff3d..0000000000 --- a/test/e2e/sidebar.test.js +++ /dev/null @@ -1,39 +0,0 @@ -const docsifyInit = require('../helpers/docsify-init'); - -// Suite -// ----------------------------------------------------------------------------- -describe('Sidebar Tests', function() { - // Tests - // --------------------------------------------------------------------------- - test('search readme', async () => { - await docsifyInit(); - await page.goto(DOCS_URL + '/#/quickstart'); - await page.fill('input[type=search]', 'Please consider donating'); - expect( - await page.innerText('.results-panel > .matching-post > a > h2') - ).toEqual('Donate'); - }); - - test('search ignore title', async () => { - const docsifyInitConfig = { - markdown: { - homepage: ` - # Hello World - - This is the homepage. - - ## Test ignore title - - This is the test ignore title. - `, - }, - scriptURLs: ['/lib/plugins/search.min.js'], - styleURLs: ['/lib/themes/vue.css'], - }; - await docsifyInit(docsifyInitConfig); - await page.fill('input[type=search]', 'Test ignore title'); - expect(await page.innerText('.results-panel h2')).toEqual( - 'Test ignore title' - ); - }); -});