Skip to content

[icons] Bring back icon testid#45766

Draft
Janpot wants to merge 11 commits intomui:masterfrom
Janpot:legacy-icons-testid
Draft

[icons] Bring back icon testid#45766
Janpot wants to merge 11 commits intomui:masterfrom
Janpot:legacy-icons-testid

Conversation

@Janpot
Copy link
Member

@Janpot Janpot commented Mar 31, 2025

Avoid split brain between dev and production. It's too confusing. This brings back the testid, but allows for removing it with property legacyTestid. We can invert the default in v8.

Use the theme defaultProps to turn off this option globally:

const theme = createTheme({
  components: {
    SvgIcon: {
      defaultProps: {
        legacyTestid: false,
      },
    },
  },
});

Plan:

  • v7.x: introduce the legacyTestid prop with default true to avoid breaking change.
  • v8.0: make it default to false, the user must always explicitly turn it on in any environment.

@Janpot Janpot added the scope: icons Changes related to the icons. label Mar 31, 2025
@mui-bot
Copy link

mui-bot commented Mar 31, 2025

Netlify deploy preview

https://deploy-preview-45766--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+492B(+0.09%) 🔺+233B(+0.15%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against d0c0a06

@Janpot Janpot changed the title [icons][proposal] legacy icon testid behavior [icons] Bring back icon testid Apr 2, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 3, 2025
@p-hlp
Copy link

p-hlp commented Jun 30, 2025

@Janpot We just updated to V7 and would love to have this merged. Is there any ETA :)?

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 30, 2025
@leonardocouy
Copy link

@Janpot would love to have this merged too. This in the only point missing to migrate from V6 to V7. Our big E2E suites are breaking due this.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Aug 11, 2025
@EtienneS76
Copy link

EtienneS76 commented Oct 6, 2025

Any info on this issue ?
It's break auto-test on our apps to

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 9, 2026
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 19, 2026
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: icons Changes related to the icons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants