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

Add transition stub to optimise testing speed in #2209

Open
itsyme opened this issue Mar 13, 2023 · 2 comments
Open

Add transition stub to optimise testing speed in #2209

itsyme opened this issue Mar 13, 2023 · 2 comments

Comments

@itsyme
Copy link
Contributor

itsyme commented Mar 13, 2023

Please confirm that you have searched existing issues in the repo

Yes, I have searched the existing issues

Any related issues?

No related issues.

What is the area that this feature belongs to?

Testing

Is your feature request related to a problem? Please describe.

Currently, a setTimeout is being used to handle the transitions when testing the Quiz component in Quiz.spec.js. This was introduced by #2184.

Describe the solution you'd like

A stub could reduce the time taken for testing by removing the time needed for the transition to complete.

Describe alternatives you've considered

No response

Additional context

No response

@itsyme
Copy link
Contributor Author

itsyme commented Apr 7, 2023

After doing some research I found out that it is not possible to create custom Vue transitions stubs that call the Javascript hooks like @after-leave in this case and we would have to use what we have currently to ensure that the @after-leave hook in the transition fires.

Resources:

I've tried using nextTick() and jest.advanceTimersByTime() to replace the use of the timeout but none of them worked as well.

@yucheng11122017
Copy link
Contributor

Chiming in to add that a setTimeout is also used for ScrollTopButton unit test. If this issue can be solved, would be good to change the test cases for that as well

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

No branches or pull requests

2 participants