From 67e475f6b68ec100cafb1aebfff41e883a0c2b7f Mon Sep 17 00:00:00 2001 From: sai6855 Date: Mon, 11 Mar 2024 11:29:21 +0530 Subject: [PATCH] fix --- .../button-group-classes.js | 2 +- .../button-group-classes.test.js | 2 +- .../test-cases/expected.js | 34 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js index 6438e578da576a..cffe90a28e2599 100644 --- a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js +++ b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js @@ -106,7 +106,7 @@ export default function transformer(file, api, options) { }); }); - const selectorRegex = new RegExp(`${replacementSelectorPrefix}${deprecatedClass}($)`); + const selectorRegex = new RegExp(`${replacementSelectorPrefix}${deprecatedClass}$`); root .find( j.Literal, diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js index 95bf4d84cf9839..f01fec88ccb4a4 100644 --- a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js +++ b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js @@ -20,7 +20,7 @@ describe('@mui/codemod', () => { const actual = jsTransform( { source: read('./test-cases/actual.js') }, { jscodeshift }, - { printOptions: { quote: 'single', trailingComma: true } }, + { printOptions: { quote: 'double', trailingComma: true } }, ); const expected = read('./test-cases/expected.js'); diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js index 06e104ac11e5f1..809d1ecfba446b 100644 --- a/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js +++ b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js @@ -1,22 +1,22 @@ import { buttonGroupClasses } from '@mui/material/ButtonGroup'; -('&.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-vertical > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped'); +("&.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-vertical > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped"); `&.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`; `&.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`; `&.${buttonGroupClasses.text} > .${buttonGroupClasses.grouped}`;