Skip to content

Commit

Permalink
fix: revert solution mui#20475
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Sallai committed Feb 27, 2021
1 parent e130b3b commit fc8617c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
10 changes: 0 additions & 10 deletions packages/material-ui/src/TableCell/TableCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,6 @@ const TableCell = React.forwardRef(function TableCell(inProps, ref) {
scope = 'col';
}

let role;
if (componentProp) {
if (isHeadCell) {
role = 'columnheader';
} else {
role = 'cell';
}
}

const variant = variantProp || (tablelvl2 && tablelvl2.variant);

const styleProps = {
Expand All @@ -196,7 +187,6 @@ const TableCell = React.forwardRef(function TableCell(inProps, ref) {
ref={ref}
className={clsx(classes.root, className)}
aria-sort={ariaSort}
role={role}
scope={scope}
styleProps={styleProps}
{...other}
Expand Down
29 changes: 0 additions & 29 deletions packages/material-ui/test/integration/TableCell.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Table from '@material-ui/core/Table';
import TableFooter from '@material-ui/core/TableFooter';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import TableBody from '@material-ui/core/TableBody';

describe('<TableRow> integration', () => {
const render = createClientRender();
Expand All @@ -26,7 +25,6 @@ describe('<TableRow> integration', () => {
expect(getByTestId('cell')).to.have.class(classes.root);
expect(getByTestId('cell')).to.have.class(classes.head);
expect(getByTestId('cell')).to.have.attribute('scope', 'col');
expect(getByTestId('cell')).not.to.have.attribute('role');
});

it('should render specified scope attribute even when in the context of a table head', () => {
Expand Down Expand Up @@ -80,31 +78,4 @@ describe('<TableRow> integration', () => {

expect(getByTestId('cell')).to.have.class(classes.footer);
});

it('sets role="columnheader" when "component" prop is set and used in the context of table head', () => {
const { getByTestId } = render(
<TableHead component="div">
<TableCell component="div" data-testid="cell" />,
</TableHead>,
);
expect(getByTestId('cell')).to.have.attribute('role', 'columnheader');
});

it('sets role="cell" when "component" prop is set and used in the context of table body ', () => {
const { getByTestId } = render(
<TableBody component="div">
<TableCell component="div" data-testid="cell" />,
</TableBody>,
);
expect(getByTestId('cell')).to.have.attribute('role', 'cell');
});

it('sets role="cell" when "component" prop is set and used in the context of table footer ', () => {
const { getByTestId } = render(
<TableFooter component="div">
<TableCell component="div" data-testid="cell" />,
</TableFooter>,
);
expect(getByTestId('cell')).to.have.attribute('role', 'cell');
});
});

0 comments on commit fc8617c

Please sign in to comment.