Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary awaits for updateComplete #3771

Merged
merged 2 commits into from
Jun 22, 2023
Merged

Conversation

dlockhart
Copy link
Member

Now that everything is using the new fixture that automatically awaits nested Lit components' updateCompletes, all of our tests that were doing that manually can... not do that.

@dlockhart dlockhart requested a review from a team as a code owner June 21, 2023 20:18
eventObj.keyCode = 27;

setTimeout(() => document.dispatchEvent(eventObj));
setTimeout(() => sendKeys('press', 'Escape'));
Copy link
Member Author

Choose a reason for hiding this comment

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

Just a little fixy-fixy while I was in here...

@github-actions
Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://pr-3771-brightspace-ui-core.d2l.dev/

Note
The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

@@ -6,15 +6,6 @@ import '../list-item-content.js';
import { expect, fixture, focusElem, html, oneEvent, sendKeysElem, waitUntil } from '@brightspace-ui/testing';
import { runConstructor } from '../../../tools/constructor-test-helper.js';

const awaitListElementUpdates = async(rootElement, queries) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Super gross. 🤮 Nice to see this gone!

@@ -123,7 +123,6 @@ describe('d2l-selection-input', () => {
<d2l-selection-input key="key3" label="label3" disabled></d2l-selection-input>
</d2l-test-selection>
`);
await el.updateComplete;
await nextFrame();
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this nextFrame() is still needed? I'm imagining you already tried to remove it...?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a lot of these in here so I didn't want to mess with too much that I wasn't completely confident would be covered by the new fixture.

@dlockhart dlockhart merged commit 16ab2cf into main Jun 22, 2023
@dlockhart dlockhart deleted the dlockhart/remove-waiting branch June 22, 2023 12:54
@ghost
Copy link

ghost commented Jun 23, 2023

🎉 This PR is included in version 2.131.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released label Jun 23, 2023
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.

2 participants