Skip to content

Commit ebfc235

Browse files
committed
moved navigateToRoute helper into the virtual-routes test file
1 parent 4bd7ac8 commit ebfc235

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

test/e2e/virtual-routes.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const docsifyInit = require('../helpers/docsify-init');
2-
const { navigateToRoute } = require('../helpers/navigate');
32
const { test, expect } = require('./fixtures/docsify-init-fixture');
43

54
test.describe('Virtual Routes - Generate Dynamic Content via Config', () => {
@@ -282,3 +281,13 @@ test.describe('Virtual Routes - Generate Dynamic Content via Config', () => {
282281
});
283282
});
284283
});
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+
}

test/helpers/navigate.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)