Unplanned
Last Updated: 16 Oct 2023 07:57 by ADMIN
Thomas
Created on: 12 Oct 2023 09:20
Category: NumericTextBox
Type: Feature Request
2
data-testid not appearing with NumericTextBox

Hello, 

I am writing Jest tests to ensure my numericTextBox is enabled, and i can't do that easily, because <NumericTextBox/> does not make my data-testid appear in the DOM.

We really want to be writing tests to ensure our components using kendo react perform the right and expected way.

Do you have any alternative to achieve this ?

Thank you

3 comments
ADMIN
Vessy
Posted on: 16 Oct 2023 07:57

Hi, Thomas,

Thanks a lot for the shared suggestion.

I have converted this thread to an official feature request so we can collect the overall interest in such improvement and plan its implementation accordingly.

I have also updated your Telerik points as a small token of gratitude for the shared feedback.

Regards,
Vessy
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Thomas
Posted on: 13 Oct 2023 08:45

OK i will adopt this technique for now, but it would be really usefull to add it to the native component, so we dont have to declare a ref, then assign it an attribute in a useEffect, 

like <NumericTextBox data-testid="blabla"> should be a lot better for the developer to use

ADMIN
Vessy
Posted on: 13 Oct 2023 08:35

Hello, Thomas,

Adding the "data-testId" field as a custom attribute to the NumericTextBox will allow you to render it successfully in the DOM:

For convenience, I have created a very basic sample demonstrating this approach:

Please, give it a try and let us know in case we can assist you any further on this matter.

Regards,
Vessy
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!