Documentation

API Referencefunction

function expectNavAsync()

Waits for the global navigation location to match the given page ID and detail.

function expectNavAsync(expect: ExpectNavOptions): Promise<void>;

Summary

This function starts checking the navigation controller periodically, and waits for the path to match the provided string. If the path still doesn’t match after the given timeout (number of milliseconds) this function throws an error.

Note
This function is asynchronous and must be await-ed.

Parameters

Return value

A promise (void) that’s resolved when the path matches, or rejected when a timeout occurs.

Examples

test("Wait for navigation", async (t) => {
  // ... navigate to a path somehow, then:
  await expectNavAsync({ path: "foo/bar" });
});