Skip to content

Commit bea7308

Browse files
committed
moved navigateToRoute to top of file
1 parent ebfc235 commit bea7308

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/e2e/virtual-routes.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
const docsifyInit = require('../helpers/docsify-init');
22
const { test, expect } = require('./fixtures/docsify-init-fixture');
33

4+
/**
5+
* Navigate to a specific route in the site
6+
* @param {import('playwright-core').Page} page the playwright page instance from the test
7+
* @param {string} route the route you want to navigate to
8+
*/
9+
async function navigateToRoute(page, route) {
10+
await page.evaluate(r => (window.location.hash = r), route);
11+
await page.waitForLoadState('networkidle');
12+
}
13+
414
test.describe('Virtual Routes - Generate Dynamic Content via Config', () => {
515
test.describe('Different Types of Virtual Routes', () => {
616
test('rendering virtual routes specified as string', async ({ page }) => {
@@ -281,13 +291,3 @@ test.describe('Virtual Routes - Generate Dynamic Content via Config', () => {
281291
});
282292
});
283293
});
284-
285-
/**
286-
* Navigate to a specific route in the site
287-
* @param {import('playwright-core').Page} page the playwright page instance from the test
288-
* @param {string} route the route you want to navigate to
289-
*/
290-
async function navigateToRoute(page, route) {
291-
await page.evaluate(r => (window.location.hash = r), route);
292-
await page.waitForLoadState('networkidle');
293-
}

0 commit comments

Comments
 (0)