MCPcopy
hub / github.com/remix-run/react-router / goto

Method goto

integration/helpers/playwright-fixture.ts:31–52  ·  view source on GitHub ↗

* Visits the href with a document request. * * @param href The href you want to visit * @param waitForHydration Wait for the page to full load/hydrate? * - `undefined` to wait for the document `load` event * - `true` wait for the network to be idle, so everything should be loaded

(href: string, waitForHydration?: boolean)

Source from the content-addressed store, hash-verified

29 * to start loading (mostly useful for testing deferred responses)
30 */
31 async goto(href: string, waitForHydration?: boolean): Promise<Response> {
32 let response = await this.page.goto(this.app.serverUrl + href, {
33 waitUntil:
34 waitForHydration === true
35 ? "networkidle"
36 : waitForHydration === false
37 ? "commit"
38 : "load",
39 });
40 if (response == null)
41 throw new Error(
42 "Unexpected null response, possible about:blank request or same-URL redirect",
43 );
44
45 if (waitForHydration === false) {
46 await this.page.waitForFunction(
47 () => !!document.body && document.body.children.length > 0,
48 );
49 }
50
51 return response;
52 }
53
54 /**
55 * Finds a link on the page with a matching href, clicks it, and waits for

Callers 15

runTestsFunction · 0.95
runBoundaryTestsFunction · 0.95
runTestsFunction · 0.95
runFormTestsFunction · 0.95
runTestsFunction · 0.95
middleware-test.tsFile · 0.80
bug-report-test.tsFile · 0.80
vite-build-test.tsFile · 0.80
rendering-test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected