bug: `MockHTMLElement` class is missing `localName` property
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I agree to follow the Code of Conduct.
- [X] I have searched for existing issues that already report this problem, without success.
Stencil Version
4.12.1
Current Behavior
When running tests with stencil test --specs , the localName of an elements (converted to a MockHTMLElement) is undefined. I'm using the dialog-polyfill library that relies on the localName when checking if an element is a dialog.
Expected Behavior
The mocked html element to have the correct localName
System Info
System: node 18.19.0
Platform: darwin (23.2.0)
CPU Model: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 cpus)
Compiler: node_modules/@stencil/core/compiler/stencil.js
Build: 1707148558
Stencil: 4.12.1 🏸
TypeScript: 5.3.3
Rollup: 2.56.3
Parse5: 7.1.2
jQuery: 4.0.0-pre
Terser: 5.27.0
Steps to Reproduce
Throw an error in a tested component checking for localName on an element reference
if (!this.elementRef.localName) {
throw new Error("Error");
}
or run yarn test in the linked repo
Code Reproduction URL
https://github.com/DarioSacco/stencil-mockhtmlelement-localname-bug
Additional Information
No response
Thanks! I've ingested this into our backlog for the team to take a look at. I think this would make a good first PR if anyone were interested in contributing to Stencil - accepting PRs!
A fix for this issue has been included as a part of today's Stencil v4.14.0 release 🎉
I'm going to close this issue out, thanks again!