Skip to content

GAUD-10062: expose waitForElem#993

Merged
dlockhart merged 3 commits into
mainfrom
GAUD-10062/expose-waitForElem
May 22, 2026
Merged

GAUD-10062: expose waitForElem#993
dlockhart merged 3 commits into
mainfrom
GAUD-10062/expose-waitForElem

Conversation

@dlockhart
Copy link
Copy Markdown
Member

In somewhat rare circumstances, changing a component's state can cause a totally different set of components within it to render. One example might be putting it into an error state. When this happens, awaiting updateComplete isn't often enough, as those new nested components might have language terms that need to load or they may need to do their own asynchronous work.

To solve this, we expose waitForElem -- which is already used internally by the original fixture call.

@dlockhart dlockhart requested a review from a team as a code owner May 21, 2026 20:43
Comment thread src/browser/fixture.js
if (typeof update === 'object' && Promise.resolve(update) === update) {
await update;
if (awaitLoadingComplete && typeof elem.getLoadingComplete === 'function') {
await elem.getLoadingComplete();
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also flipped the order here. We first wait for getLoadingComplete and then we wait for updateComplete. The reasoning here is that almost always getLoadingComplete resolving is going to trigger some kind of state change, so we wait for updateComplete after that.

Comment thread README.md
```

### Accessibility Testing with aXe
### Accessibility Testing with axe
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I was here...

Comment thread test/browser/fixture.test.js
@dlockhart dlockhart merged commit 9a27b12 into main May 22, 2026
4 checks passed
@dlockhart dlockhart deleted the GAUD-10062/expose-waitForElem branch May 22, 2026 13:51
@d2l-github-release-tokens
Copy link
Copy Markdown

🎉 This PR is included in version 1.45.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants