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

bug: MockHTMLElement class is missing localName property #5342

Closed
3 tasks done
DarioSacco opened this issue Feb 9, 2024 · 2 comments
Closed
3 tasks done

bug: MockHTMLElement class is missing localName property #5342

DarioSacco opened this issue Feb 9, 2024 · 2 comments
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil Good First Issue This is a good first issue for someone wantng to contribute to Stencil!

Comments

@DarioSacco
Copy link

Prerequisites

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

@ionitron-bot ionitron-bot bot added the triage label Feb 9, 2024
@rwaskiewicz rwaskiewicz added Good First Issue This is a good first issue for someone wantng to contribute to Stencil! Bug: Validated This PR or Issue is verified to be a bug within Stencil labels Feb 9, 2024
@ionitron-bot ionitron-bot bot removed the triage label Feb 9, 2024
@rwaskiewicz
Copy link
Contributor

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!

@rwaskiewicz
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil Good First Issue This is a good first issue for someone wantng to contribute to Stencil!
Projects
None yet
Development

No branches or pull requests

2 participants