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

MAN-3694 -- Add a waitUntilSettled function that waits for an element to finish updating #554

Closed
wants to merge 2 commits into from

Conversation

mpharoah-d2l
Copy link

https://desire2learn.atlassian.net/browse/MAN-3694

This PR adds a public waitUntilSettled function that more reliably waits for an element to finish updating. Our team intends to use this in multiple repos to help reduce vdiff flake.

@mpharoah-d2l mpharoah-d2l requested a review from a team as a code owner November 27, 2024 15:04
D2L.Siren &&
D2L.Siren.ActionQueue &&
D2L.Siren.ActionQueue.isPending &&
D2L.Siren.ActionQueue.enqueue;
Copy link
Member

Choose a reason for hiding this comment

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

This feels like too much D2L-specific knowledge leakage into what we're hoping to keep as a bare bones testing library. Have you looked at the getLoadingComplete stuff (or mixin) to handle this kind of thing? Each component that does async calls would need to be aware of it, but that's the way we'd always imagined this stuff working.

If you did want to try and write a single thing that "waits for things to settle", you could still use getLoadingComplete in a shared mixin and put this logic there.

Alternately, you could create your own fixture method that calls into @brightspace-ui/testing's fixture (which calls into the open-wc one) but then additionally waits for more stuff?

Copy link
Author

@mpharoah-d2l mpharoah-d2l Nov 28, 2024

Choose a reason for hiding this comment

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

Alternately, you could create your own fixture method that calls into @brightspace-ui/testing's fixture (which calls into the open-wc one) but then additionally waits for more stuff?

We actually do that in d2l-rubric, but also add the waitUntilSettled method to the fixture so we can call it again after simulating clicks and such. We were hoping to add this to the testing repo to avoid copy-pasting the same code to our other repos. Is there another library we can put this in if its too D2L specific for this one?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm I'm not sure... there's a lot of Siren-specific stuff in here so maybe as a testing utility in siren-sdk? Or does your team have a shared utils library?

Copy link
Author

Choose a reason for hiding this comment

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

No, but I guess we can just make one

@mpharoah-d2l
Copy link
Author

Going to just copy paste it in d2l-outcomes instead

@mpharoah-d2l mpharoah-d2l deleted the mpharoah/MAN-3694 branch November 28, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants