solid-design-system / solid

Monorepo for Union Investment's Solid Design System.
https://solid-design-system.fe.union-investment.de/x.x.x/storybook/
Other
21 stars 4 forks source link

feat: ✨ add testing and tracking attributes to components #1059

Open karlbaumhauer opened 6 months ago

karlbaumhauer commented 6 months ago

User Story

As a user of the Solid Design System, I would like to utilize an additional attribute to be used for tracking implemenatation, as well as an additional attribute to be used for testing on each component, so that solid components can be used with the current tracking implementation and within the current testing structure.

Suggested Solution

A global script adds the following attributes to each component:

  1. Tracking key: data-sd-version value: current version of the library (eg. 3.3.0)
  2. Testing key: data-sd-name value: component name (eg. sd-button)

Implementation details

This should be implemented as a one-time effort for all components, so e. g. in the sd-element, being the base component.

  1. The version could be easily replaced via Vite with some String replacement.
  2. Not sure about the component name, but even that should be possible via connectedCallback, which sets the attribute containing the tag of this and maybe having some kind of regex which removes numbers followed by dashes.

DoR

DoD

karlbaumhauer commented 6 months ago

@mariohamann assigned to you in order to read through it and see if anything is missing. I could not find any information for the tracking part and especially no information about the priority.

@yoezlem assigned to you in order to prioritize. I did not create it as epic, as we only have dev implementation for it. The testing prio is medium IMO.

mariohamann commented 5 months ago

Updated and removed myself.