DatePicker: Only outter HTML is rendered in Enzyme
Describe the problem
When I run my UT, which contains the DatePicker in the Enzyme, the DatePicker cannot be well rendered. It only shows an outer tag <ui5-datepicker> that contains no children nodes.

As the below picture shows, other components (ui5-checkbox) have shadow DOM while the date picker not.

I'm not sure whether this is caused by my code or the component. Sorry that my description is a little ambiguous. Could you give me some ideas?
UI5 Web Components for React Information
@ui5/webcomponents version: 1.0.0-rc.7
@ui5/webcomponents-react version: 0.9.11
Operating System: MacOS
Browser:Chrome
Hey @SunnyWind,
the only idea which would come spontaneously to my mind would be mismatching versions of UI5 Web Components and Web Components for React. Just to make sure whether the versions are matching, could you please run npm ls @ui5/webcomponents and npm ls @ui5/webcomponents-react and paste the results here?
EDIT: I tried to come up with a codesandbox for that issue, but for it it looks like the tags are properly rendered. Am I missing something?
@MarcusNotheis Thanks for the prompt reply.
Here is the dependency:
$ npm ls @ui5/webcomponents
/Projects/demo
├── @ui5/[email protected]
└─┬ @ui5/[email protected]
└── @ui5/[email protected] deduped
$ npm ls @ui5/webcomponents-react
/Projects/demo
└── @ui5/[email protected]
I wrote a simple version of my code.

And it gets the following result.

Hey @SunnyWind, thanks, all dependencies are looking fine. Which test runner are you using? Looks like Karma because there is a screenshot from Chrome Dev Tools? Is there any repo (internal repo would also be fine in case you are working at SAP) for me to reproduce?
Hi @MarcusNotheis
Hah, All your guess is right. Here is the internal repo link https://github.wdf.sap.corp/sap-jam/ct
I'm not sure you can access our repo. The Karma config file path is config/karma.conf.js
Many thanks.
Hi @MarcusNotheis Hah, All your guess is right. Here is the internal repo link https://github.wdf.sap.corp/sap-jam/ct I'm not sure you can access our repo. The Karma config file path is
config/karma.conf.jsMany thanks.
Hey @SunnyWind, looks like the Repo is private. Could you ping me on Slack or add me to the repo with read privileges?
As discussed, I'll forward this to our UI5 Web Components colleagues. Additional Information:
The date picker can be properly rendered in our APP, but cannot be rendered well in my Karma test. After the careful test, I found that the date picker can be completely rendered when it’s in the first test case. It implies that the fore test cases affect the display of behind components. There are too many test cases. Every time a test case is over, all DOM elements will be removed. I don’t know why the order of test cases can cause this problem. Assume there are 5 tests and test X. If tests run as the order X, 1, 2, 3, 4, X, 5 there will be two date pickers rendered. If tests run as 1,2,3,4,X,5, there will be no date pickers. The test X is the test that is show in the above screenshot.
Hello colleagues,
it seems the custom element was not upgraded. The most common reason for that is that it was not imported. The second possibility is a JS error that took place and prevented the upgrade from happening.
There's not much else that comes to mind without a reproducible page we can debug.
Regards, Vladi
Hi @vladitasev ,
Thanks for your advice.
I see no JS error on the console, so it should not be the reason.
The element should be imported explicitly since there rendered a tag <ui5-datepicker>.
I noticed that the fake XHR from sinon.js can affect the issue. It's strange since the rendering of UI5 components should not include XHR requests...
You will always see the <ui5-datepicker tag in Dev Tools (if you meant that) when you use it the html file, no matter you imported or did not the component. But the presence or the lack of Shadow DOM is a key characteristic. In your case the DatePicker does not have Shadow DOM, which either means the import is missing, or something prevented the component from defining and initialization.
Hello @SunnyWind we are closing the issue, because without a reproducible page we can not do much.
Best regards, ilhan