Skip to content

Commit

Permalink
[code-infra] Break package dependency cycle between @mui/material and…
Browse files Browse the repository at this point in the history
… @mui/icons-material (#40400)
  • Loading branch information
michaldudak authored Jan 2, 2024
1 parent 8837023 commit ad912d6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/mui-material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"devDependencies": {
"@mui-internal/babel-macros": "^1.0.0",
"@mui-internal/test-utils": "^1.0.0",
"@mui/icons-material": "^5.15.2",
"@mui/lab": "5.0.0-alpha.158",
"@popperjs/core": "^2.11.8",
"@rollup/plugin-replace": "^5.0.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from 'react';
import { expect } from 'chai';
import { createRenderer, describeConformance } from '@mui-internal/test-utils';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
import TabScrollButton, { tabScrollButtonClasses as classes } from '@mui/material/TabScrollButton';
import { createSvgIcon } from '@mui/material/utils';

const ArrowBackIcon = createSvgIcon(<path d="M3 3h18v18H3z" />, 'ArrowBack');
const ArrowForwardIcon = createSvgIcon(<path d="M3 3h18v18H3z" />, 'ArrowForward');

describe('<TabScrollButton />', () => {
const defaultProps = {
Expand Down
16 changes: 12 additions & 4 deletions packages/mui-material/src/TablePagination/TablePagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ import { outlinedInputClasses } from '@mui/material/OutlinedInput';
import { filledInputClasses } from '@mui/material/FilledInput';
import IconButton, { iconButtonClasses } from '@mui/material/IconButton';
import { svgIconClasses } from '@mui/material/SvgIcon';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
import KeyboardDoubleArrowLeftRoundedIcon from '@mui/icons-material/KeyboardDoubleArrowLeftRounded';
import KeyboardDoubleArrowRightRoundedIcon from '@mui/icons-material/KeyboardDoubleArrowRightRounded';
import { createSvgIcon } from '@mui/material/utils';

const ArrowBackIcon = createSvgIcon(<path d="M3 3h18v18H3z" />, 'ArrowBack');
const ArrowForwardIcon = createSvgIcon(<path d="M3 3h18v18H3z" />, 'ArrowForward');
const KeyboardDoubleArrowLeftRoundedIcon = createSvgIcon(
<path d="M3 3h18v18H3z" />,
'KeyboardDoubleArrowLeftRounded',
);
const KeyboardDoubleArrowRightRoundedIcon = createSvgIcon(
<path d="M3 3h18v18H3z" />,
'KeyboardDoubleArrowRightRounded',
);

describe('<TablePagination />', () => {
const noop = () => {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from 'react';
import { expect } from 'chai';
import { createRenderer, describeConformance } from '@mui-internal/test-utils';
import SortIcon from '@mui/icons-material/Sort';
import TableSortLabel, { tableSortLabelClasses as classes } from '@mui/material/TableSortLabel';
import ButtonBase from '@mui/material/ButtonBase';
import { createSvgIcon } from '@mui/material/utils';

const SortIcon = createSvgIcon(<path d="M3 3h18v18H3z" />, 'Sort');

describe('<TableSortLabel />', () => {
const { render } = createRenderer();
Expand Down
6 changes: 4 additions & 2 deletions packages/mui-material/src/Tabs/Tabs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import {
strictModeDoubleLoggingSuppressed,
waitFor,
} from '@mui-internal/test-utils';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
import Tab from '@mui/material/Tab';
import Tabs, { tabsClasses as classes } from '@mui/material/Tabs';
import { svgIconClasses } from '@mui/material/SvgIcon';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { createSvgIcon } from '@mui/material/utils';
import capitalize from '../utils/capitalize';

const ArrowBackIcon = createSvgIcon(<path d="M3 3h18v18H3z" />, 'ArrowBack');
const ArrowForwardIcon = createSvgIcon(<path d="M3 3h18v18H3z" />, 'ArrowForward');

function findScrollButton(container, direction) {
return container.querySelector(`svg[data-testid="KeyboardArrow${capitalize(direction)}Icon"]`);
}
Expand Down

0 comments on commit ad912d6

Please sign in to comment.