You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
I am writing jest tests for my web-components. I,m animating HTMLElelements with the animate method. It works fine when I create the component in the browser in normal way, But it breaks if I create the component in my unit tests using newSpecPage interface. The reason for breaking is that jest in stencil replace normal DOM with MockDOM and the mockHTMLElement on which I am using animate is missing the method animate
Expected behavior:
MockHtmlElement should have all the methods of an HTMLElement
Steps to reproduce:
1- Create a simple component, use animate on any Element
2- Run unit tests over the component
@Component({tag: 'my-component'})exportclassMyComponent{
@Element()rootElem:HTMLElement;componentDidLoad(){// throws TypeError: this.rootElem.animate is not a function// this.rootElem is of type MockHTML element when run from test else HTMLELementthis.rootElem.animate([{transform: 'rotate(90deg)'}]);}render(){return(<divid="container"></div>);}}
The text was updated successfully, but these errors were encountered:
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.
Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
I am writing jest tests for my web-components. I,m animating HTMLElelements with the animate method. It works fine when I create the component in the browser in normal way, But it breaks if I create the component in my unit tests using newSpecPage interface. The reason for breaking is that jest in stencil replace normal DOM with MockDOM and the mockHTMLElement on which I am using animate is missing the method animate
Expected behavior:
MockHtmlElement should have all the methods of an HTMLElement
Steps to reproduce:
1- Create a simple component, use animate on any Element
2- Run unit tests over the component
Related code:
my-component.spec.ts
my-component.tsx
The text was updated successfully, but these errors were encountered: