Skip to content

Commit ce6c555

Browse files
Add multi-page search test
1 parent a5409ec commit ce6c555

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

test/e2e/sidebar.test.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,26 @@ describe('Sidebar Tests', function() {
1313
1414
This is the homepage.
1515
`,
16+
sidebar: `
17+
- [Home page](/)
18+
- [Test Page](test)
19+
`,
20+
},
21+
routes: {
22+
'/test.md': `
23+
# Test Page
24+
25+
This is a custom route.
26+
`,
1627
},
1728
scriptURLs: ['/lib/plugins/search.min.js'],
18-
styleURLs: ['/lib/themes/vue.css'],
1929
};
30+
2031
await docsifyInit(docsifyInitConfig);
21-
await page.fill('input[type=search]', 'Hello');
22-
expect(await page.innerText('.results-panel h2')).toEqual('Hello World');
32+
await page.fill('input[type=search]', 'hello');
33+
await expect(page).toEqualText('.results-panel h2', 'Hello World');
34+
await page.click('.clear-button');
35+
await page.fill('input[type=search]', 'test');
36+
await expect(page).toEqualText('.results-panel h2', 'Test Page');
2337
});
2438
});

0 commit comments

Comments
 (0)