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

feat(carousel): add pause-on-hover prop #1423

Merged
merged 2 commits into from
Feb 8, 2021
Merged

feat(carousel): add pause-on-hover prop #1423

merged 2 commits into from
Feb 8, 2021

Conversation

kooriookami
Copy link
Member

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow Element's contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

@element-bot
Copy link
Member

@jw-foss
Copy link
Member

jw-foss commented Feb 5, 2021

Please add tests for the changes.

await nextTick()
await wrapper.find('.el-carousel').trigger('mouseenter')
const items = wrapper.vm.$el.querySelectorAll('.el-carousel__item')
await wait(60)
Copy link
Member

Choose a reason for hiding this comment

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

Can we use jest.useFakeTimer to implement this? Using wait seems to be a bad habit for testing these.

You can set jest.useFakeTimer at the head of the testing file.
Then use jest.runAllTimers or jest.runAllTicks to finish the work.

@jw-foss jw-foss merged commit 67ea05e into dev Feb 8, 2021
@jw-foss jw-foss deleted the feat/carousel branch February 8, 2021 08:23
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.

None yet

3 participants