Skip to content

Commit

Permalink
Remove hover tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai committed Oct 8, 2024
1 parent f843e03 commit 4eaffa2
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions packages/mui-material/src/IconButton/IconButton.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,53 +142,6 @@ describe('<IconButton />', () => {
)).not.to.throw();
});

it('should apply the hover background by default', function test() {
if (!/jsdom/.test(window.navigator.userAgent)) {
this.skip();
}

const { container, getByTestId } = render(<IconButton data-testid="icon-button" />);

fireEvent.mouseMove(container.firstChild, {
clientX: 19,
});
expect(getByTestId('icon-button')).toHaveComputedStyle({
backgroundColor: 'rgba(0, 0, 0, 0.04)',
});
});

it('should apply the colored hover background if color is provided', function test() {
if (!/jsdom/.test(window.navigator.userAgent)) {
this.skip();
}

const { container, getByTestId } = render(
<IconButton data-testid="icon-button" color="primary" />,
);

fireEvent.mouseMove(container.firstChild, {
clientX: 19,
});
expect(getByTestId('icon-button')).toHaveComputedStyle({
backgroundColor: 'rgba(25, 118, 210, 0.04)',
});
});

it('should not apply the hover background if disableRipple is true', function test() {
if (!/jsdom/.test(window.navigator.userAgent)) {
this.skip();
}

const { container, getByTestId } = render(
<IconButton disableRipple data-testid="icon-button" />,
);

fireEvent.mouseMove(container.firstChild, {
clientX: 19,
});
expect(getByTestId('icon-button')).toHaveComputedStyle({ backgroundColor: 'rgba(0, 0, 0, 0)' });
});

it('should disable ripple if disableRipple:true is set in MuiButtonBase', async () => {
const { container, getByRole } = render(
<ThemeProvider
Expand Down

0 comments on commit 4eaffa2

Please sign in to comment.