Skip to content

Commit

Permalink
Fix popover and popper tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed Feb 7, 2024
1 parent bd18f1c commit f89283d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/mui-material/src/Popover/Popover.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { getOffsetLeft, getOffsetTop } from './Popover';
import useForkRef from '../utils/useForkRef';
import styled from '../styles/styled';

function createAnchor(element = 'div') {
const anchor = document.createElement(element);
function createAnchor() {
const anchor = document.createElement('div');
document.body.appendChild(anchor);
return anchor;
}
Expand Down Expand Up @@ -862,7 +862,7 @@ describe('<Popover />', () => {

describe('prop: marginThreshold', () => {
[0, 18, 16].forEach((marginThreshold) => {
function getElementStyleOfOpenPopover(anchorEl = createAnchor('svg')) {
function getElementStyleOfOpenPopover(anchorEl = createAnchor()) {
let style;
render(
<Popover
Expand Down
6 changes: 3 additions & 3 deletions packages/mui-material/src/Popper/Popper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { ThemeProvider, createTheme } from '@mui/system';
import Grow from '@mui/material/Grow';
import Popper from '@mui/material/Popper';

function createAnchor(element = 'div') {
const anchor = document.createElement(element);
function createAnchor() {
const anchor = document.createElement('div');
document.body.appendChild(anchor);
return anchor;
}
Expand All @@ -21,7 +21,7 @@ describe('<Popper />', () => {
let rtlTheme;
const { clock, render } = createRenderer({ clock: 'fake' });
const defaultProps = {
anchorEl: () => createAnchor('svg'),
anchorEl: () => createAnchor(),
children: <span>Hello World</span>,
open: true,
};
Expand Down

0 comments on commit f89283d

Please sign in to comment.