feat(Chore)!: replace data-component-name with data-testid#1622
Conversation
Remove the Tu skin entirely: skin definition, logo files and their shells, the registry entry, the public exports, and all related stories, screenshot tests, snapshots, storybook/playroom wiring, and docs. BREAKING CHANGE: the Tu skin has been removed. The TuLogo component and the TU_SKIN, getTuSkin, and tuPalette exports are no longer available.
Complete the O2-new cleanup missed in the initial replacement: - playroom/themes.tsx: rename O2_New/O2_New_iOS to O2/O2_iOS so the Playroom O2 theme resolves (fixes the TypeScript build). - audit-accessibility: audit the O2 skin instead of the removed O2-new. - generate-design-tokens and import-mistica-icons: drop the stale o2-new entries so regeneration does not recreate the deleted files. - docs: point to getO2Skin/o2Palette and a single o2 skin row.
The Movistar-new skin no longer exists after its promotion to the canonical Movistar skin, so its committed image snapshots are obsolete. Regeneration does not delete obsolete image files, so remove them here.
These tests were pinned to the legacy Movistar skin because they were unstable on Movistar-new. Since Movistar now is the former Movistar-new, the warning still applies; reword it instead of dropping it.
…ng issue Replace the free-text TODO comments with the `// todo <link> <description>` pattern, pointing at the tracking issue for the screenshot instability.
The O2-new skin was removed from all acceptance test parametrizations when O2-new replaced O2. These snapshot images are no longer generated and are removed as obsolete output.
…-remove-movistar-new
Removes the deprecated data-component-name attribute across all components. getPrefixedDataAttributes now emits only data-testid, and the three hardcoded data-component-name attributes (BurgerMenuIcon, NavigationBarActionGroup, Dialog) are replaced; the duplicate on FixedFooter is dropped. Ref: #1598
There was a problem hiding this comment.
Pull request overview
This PR is part of the 17.0.0 breaking-change plan and aims to complete the migration away from the deprecated data-component-name attribute by standardizing on data-testid across Mistica components and shared DOM utilities.
Changes:
- Updates
getPrefixedDataAttributesto stop emittingdata-component-namewhen acomponentNameis provided, emitting onlydata-testid. - Replaces hardcoded
data-component-nameusages withdata-testidinnavigation-bar.tsxanddialog.tsx. - Removes a redundant
data-component-namefromFixedFooterLayout, keepingdata-testidonly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/utils/dom.tsx | Adjusts the shared data-attribute utility to prefer data-testid. |
| src/navigation-bar.tsx | Replaces remaining hardcoded data-component-name attributes with data-testid. |
| src/fixed-footer-layout.tsx | Removes redundant deprecated attribute, keeping data-testid. |
| src/dialog.tsx | Replaces hardcoded data-component-name with data-testid on the dialog container. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
this was bad by previous PRs. fixed here
There was a problem hiding this comment.
same here: fixed on this PR
|
Size stats
|
| .directory | ||
| .DS_Store | ||
| .idea/ | ||
| mistica-web.iml |
There was a problem hiding this comment.
I use intellij, I don't want to further commit it, unless explicitly
Remove the `never` restriction on `component-name` in `DataAttributes`, making it a valid key for data attribute objects.
this is blocking the PR while Marcos is on vacations + reviewed by Abel. We're good to go
|
🎉 This PR is included in version 16.72.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 17.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #1598. Part of #626 — Major release plan 17.0.0.
Changes
data-component-nameattribute fromgetPrefixedDataAttributes, which now emits onlydata-testid. This covers every component that renders test attributes through the shared utility.data-component-nameattributes withdata-testid:BurgerMenuIconandNavigationBarActionGroupinnavigation-bar.tsx, andDialogindialog.tsx.data-component-nameonFixedFooter, which already carried a matchingdata-testid.Tests
data-component-name; the dedicatedtestid-test.tsxand all other selectors already usedata-testid, so no test changes were required.testid-test(15 passed),dialog-test(16 passed), andmain-navigation-bar-test(2 passed).Stack position — 5 of 10
This PR targets the branch from #1617 and can only be merged after #1617 lands on
master. GitHub will retarget it tomasterautomatically as the parent merges.For the full merge strategy and ordering, see #626. Do not merge out of order.