Skip to content

Commit

Permalink
[test] Remove createMount test util (#42703)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah authored Jun 26, 2024
1 parent 4699194 commit 53899d7
Show file tree
Hide file tree
Showing 32 changed files with 202 additions and 557 deletions.
136 changes: 0 additions & 136 deletions packages-internal/test-utils/src/createMount.tsx

This file was deleted.

68 changes: 0 additions & 68 deletions packages-internal/test-utils/src/findOutermostIntrinsic.test.js

This file was deleted.

19 changes: 0 additions & 19 deletions packages-internal/test-utils/src/findOutermostIntrinsic.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages-internal/test-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export { default as describeConformance } from './describeConformance';
export * from './describeConformance';
export { default as createDescribe } from './createDescribe';
export * from './createRenderer';
export { default as createMount } from './createMount';
export { default as findOutermostIntrinsic, wrapsIntrinsicElement } from './findOutermostIntrinsic';
export {
default as focusVisible,
simulatePointerDevice,
Expand Down
4 changes: 1 addition & 3 deletions packages/mui-base/src/Badge/Badge.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as React from 'react';
import { createRenderer, createMount } from '@mui/internal-test-utils';
import { createRenderer } from '@mui/internal-test-utils';
import { Badge, badgeClasses as classes } from '@mui/base/Badge';
import { describeConformanceUnstyled } from '../../test/describeConformanceUnstyled';

describe('<Badge />', () => {
const { render } = createRenderer();
const mount = createMount();

describeConformanceUnstyled(
<Badge>
Expand All @@ -15,7 +14,6 @@ describe('<Badge />', () => {
classes,
inheritComponent: 'span',
render,
mount,
refInstanceof: window.HTMLSpanElement,
testComponentPropWith: 'div',
slots: {
Expand Down
4 changes: 1 addition & 3 deletions packages/mui-base/src/Button/Button.test.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import * as React from 'react';
import { act, createMount, createRenderer, fireEvent } from '@mui/internal-test-utils';
import { act, createRenderer, fireEvent } from '@mui/internal-test-utils';
import { expect } from 'chai';
import { spy } from 'sinon';
import { Button, buttonClasses } from '@mui/base/Button';
import { describeConformanceUnstyled } from '../../test/describeConformanceUnstyled';

describe('<Button />', () => {
const mount = createMount();
const { render, renderToString } = createRenderer();

describeConformanceUnstyled(<Button />, () => ({
inheritComponent: 'button',
render,
mount,
refInstanceof: window.HTMLButtonElement,
testComponentPropWith: 'span',
slots: {
Expand Down
4 changes: 1 addition & 3 deletions packages/mui-base/src/FormControl/FormControl.test.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import * as React from 'react';
import { expect } from 'chai';
import { spy } from 'sinon';
import { createMount, createRenderer, fireEvent } from '@mui/internal-test-utils';
import { createRenderer, fireEvent } from '@mui/internal-test-utils';
import { FormControl, formControlClasses, useFormControlContext } from '@mui/base/FormControl';
import { describeConformanceUnstyled } from '../../test/describeConformanceUnstyled';

describe('<FormControl />', () => {
const mount = createMount();
const { render } = createRenderer();

describeConformanceUnstyled(<FormControl />, () => ({
inheritComponent: 'div',
render,
mount,
refInstanceof: window.HTMLDivElement,
testComponentPropWith: 'div',
slots: {
Expand Down
4 changes: 1 addition & 3 deletions packages/mui-base/src/Input/Input.test.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { createMount, createRenderer, fireEvent, screen, act } from '@mui/internal-test-utils';
import { createRenderer, fireEvent, screen, act } from '@mui/internal-test-utils';
import { expect } from 'chai';
import { spy } from 'sinon';
import { Input, inputClasses, InputOwnerState } from '@mui/base/Input';
import { describeConformanceUnstyled } from '../../test/describeConformanceUnstyled';

describe('<Input />', () => {
const mount = createMount();
const { render } = createRenderer();

describeConformanceUnstyled(<Input />, () => ({
inheritComponent: 'div',
render,
mount,
refInstanceof: window.HTMLDivElement,
testComponentPropWith: 'div',
slots: {
Expand Down
8 changes: 0 additions & 8 deletions packages/mui-base/src/Menu/Menu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import { expect } from 'chai';
import { spy } from 'sinon';
import {
createMount,
createRenderer,
fireEvent,
act,
Expand All @@ -27,7 +26,6 @@ const testContext: DropdownContextValue = {
};

describe('<Menu />', () => {
const mount = createMount();
const { render: internalRender } = createRenderer();

async function render(
Expand All @@ -46,12 +44,6 @@ describe('<Menu />', () => {
<DropdownContext.Provider value={testContext}>{node}</DropdownContext.Provider>,
);
},
mount: (node: React.ReactNode) => {
const wrapper = mount(
<DropdownContext.Provider value={testContext}>{node}</DropdownContext.Provider>,
);
return wrapper.childAt(0);
},
refInstanceof: window.HTMLDivElement,
slots: {
root: {
Expand Down
9 changes: 1 addition & 8 deletions packages/mui-base/src/MenuButton/MenuButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { expect } from 'chai';
import { spy } from 'sinon';
import userEvent from '@testing-library/user-event';
import { act, createMount, createRenderer } from '@mui/internal-test-utils';
import { act, createRenderer } from '@mui/internal-test-utils';
import { MenuButton, menuButtonClasses } from '@mui/base/MenuButton';
import { DropdownContext, DropdownContextValue, DropdownActionTypes } from '@mui/base/useDropdown';
import { describeConformanceUnstyled } from '../../test/describeConformanceUnstyled';
Expand All @@ -21,7 +21,6 @@ const testContext: DropdownContextValue = {
};

describe('<MenuButton />', () => {
const mount = createMount();
const { render } = createRenderer();

describeConformanceUnstyled(<MenuButton />, () => ({
Expand All @@ -31,12 +30,6 @@ describe('<MenuButton />', () => {
<DropdownContext.Provider value={testContext}>{node}</DropdownContext.Provider>,
);
},
mount: (node: React.ReactNode) => {
const wrapper = mount(
<DropdownContext.Provider value={testContext}>{node}</DropdownContext.Provider>,
);
return wrapper.childAt(0);
},
refInstanceof: window.HTMLButtonElement,
slots: {
root: {
Expand Down
Loading

0 comments on commit 53899d7

Please sign in to comment.