Skip to content

LegacyTabComponent fails to render in unit tests when migrating to iTwinUI 3 #2404

Answered by r100-stack
hl662 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for your investigation! I believe you are using JSDOM? If so, Element.scrollTo() is not implemented in it. So you'd need to define a function for it or mock it or something similar.

Since we also use JSDOM in our vitest unit tests for Tabs we have also defined a dummy function for scrollTo:

window.HTMLElement.prototype.scrollTo = () => {};

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hl662
Comment options

hl662 Jan 16, 2025
Collaborator Author

Answer selected by hl662
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants