Skip to content

Commit

Permalink
test: update test environment to await for font loading
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 549437948
  • Loading branch information
Extended Component Library Team authored and copybara-github committed Jul 19, 2023
1 parent 5d3fc56 commit 0fd82f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/testing/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ export class Environment {

/**
* Waits for the page to become stable; including waiting for any Lit elements
* to finish rendering.
* to finish rendering and for fonts to load.
*/
async waitForStability() {
if (this.environmentRoot) {
await this.waitForLitRender(this.environmentRoot);
}
await document.fonts.ready;
}

/**
Expand Down

0 comments on commit 0fd82f8

Please sign in to comment.