Closed chiragSAP closed 10 months ago
Hello, thank you very much for this message. It seems we face exactly the same issue when we want to upgrade ui5-webComponents from 1.16.0 to 1.17.0. Some of our unit tests written in JEST fail. We are using the web components in angular. And from what we see the RadioButton causes the problem (at least also the RadioButton). I attach a little picture from the error log as well:
We hope for a quick fix as well 👍 Thanks for bringing this up.
Hello @SAP/ui5-webcomponents-topic-rd,
It seems like a regression in the RadioButton is causing some tests to fail.
Could you please look into it?
Regards, Plamen
The issue is being reported for Chrome browser but the environment these tests are being ran on is actually JSDom, which doesn't yet support attachInternals
. See https://github.com/jsdom/jsdom/issues/3444
At the moment JSDom is not present in the support matrix https://github.com/SAP/ui5-webcomponents#browser-support
Hi @chiragSAP
until attachInternals
is supported by JSDom you can probably use the element-internals-polyfill. Just install it and then import it in your Jest setup-file.
Hi @chiragSAP Does the above suggestion to use elements-internals-polyfill solve your problem with running your tests on JSDom?
Hi @gmkv After implementing the above mentioned fix, I was able to resolve the issue. Thanks for the support.
Bug Description
When ui5-webcomponents version is upgraded to 1.17.0 all the unit tests involving radio button starts failing with the error "TypeError: this.attachInternals is not a function".
Affected Component
Radio Button
Expected Behaviour
Unit tests should pass.
Isolated Example
https://codesandbox.io/p/sandbox/cocky-feynman-kd2t5f?file=/src/App.tsx:8,41
Steps to Reproduce
Log Output, Stack Trace or Screenshots
Priority
High
UI5 Web Components Version
1.17.0
Browser
Chrome
Operating System
Windows
Additional Context
Need to upgrade the version to resolve https://github.com/SAP/ui5-webcomponents/issues/6895 and https://github.com/SAP/ui5-webcomponents-react/issues/4397
Organization
No response
Declaration