adeo / mozaic-design-system

Mozaic Design System
https://mozaic.adeo.cloud
Apache License 2.0
71 stars 17 forks source link

Add "data-cy" props and attributes to "all" inputs #1609

Open NicoJolyAdeo opened 1 month ago

NicoJolyAdeo commented 1 month ago

I want to propose an evolution/improvement on

Component

Description

It's sometimes difficult to get a selector (from ADS component) to test it (E2E/Cypress,...)... So, is it possible to add an attribute and props with "data-cy" (for example) on each input ?

Describe the solution you would like

Add attribute "data-cy" with generic value "..." and props "prefix" and "suffix" (optionals), like :

In MButton.vue : <button data-cy="prefix?-" + "-the-unique-generic-datacy-name-for-this-button-in-this-component" + "-suffix?" /> <button data-cy="prefix?-" + "-the-unique-generic-datacy-name-for-this-button-in-this-component" + "-suffix?" />

Describe the alternatives you considered

No response

Additional comments

No response

mohamedMok commented 2 weeks ago

Hello @NicoJolyAdeo,

Thanks for your feeback, but this won't be part of the design system. It should and could be managed by the users. In most of our librairies you can pass attributes on the components

NicoJolyAdeo commented 2 weeks ago

It was in the cards, though, and an attribute appears in the "doc" about it. QA (Quality) could be part of the ADS i think.

Capture d'écran 2024-09-02 164445