11/* eslint-env mocha */
22import * as React from 'react' ;
33import { expect } from 'chai' ;
4- import { ReactWrapper } from 'enzyme' ;
54import ReactTestRenderer from 'react-test-renderer' ;
6- import createMount from './createMount' ;
75import createDescribe from './createDescribe' ;
8- import findOutermostIntrinsic from './findOutermostIntrinsic' ;
96import { MuiRenderResult } from './createRenderer' ;
107
118function capitalize ( string : string ) : string {
@@ -46,7 +43,6 @@ export interface ConformanceOptions {
4643 after ?: ( ) => void ;
4744 inheritComponent ?: React . ElementType ;
4845 render : ( node : React . ReactElement < any > ) => MuiRenderResult ;
49- mount ?: ( node : React . ReactElement < any > ) => ReactWrapper ;
5046 only ?: Array < keyof typeof fullSuite > ;
5147 skip ?: Array < keyof typeof fullSuite | 'classesRoot' > ;
5248 testComponentsRootPropWith ?: string ;
@@ -66,9 +62,6 @@ export interface ConformanceOptions {
6662 testCustomVariant ?: boolean ;
6763 testVariantProps ?: object ;
6864 testLegacyComponentsProp ?: boolean ;
69- wrapMount ?: (
70- mount : ( node : React . ReactElement < any > ) => ReactWrapper ,
71- ) => ( node : React . ReactElement < any > ) => ReactWrapper ;
7265 slots ?: Record < string , SlotTestingOptions > ;
7366 ThemeProvider ?: React . ElementType ;
7467 createTheme ?: ( arg : any ) => any ;
@@ -83,18 +76,6 @@ export interface ConformanceOptions {
8376 * - has the type of `inheritComponent`
8477 */
8578
86- /**
87- * Returns the component with the same constructor as `component` that renders
88- * the outermost host
89- */
90- export function findRootComponent ( wrapper : ReactWrapper , component : string | React . ElementType ) {
91- const outermostHostElement = findOutermostIntrinsic ( wrapper ) . getElement ( ) ;
92-
93- return wrapper . find ( component as string ) . filterWhere ( ( componentWrapper ) => {
94- return componentWrapper . contains ( outermostHostElement ) ;
95- } ) ;
96- }
97-
9879export function randomStringValue ( ) {
9980 return `s${ Math . random ( ) . toString ( 36 ) . slice ( 2 ) } ` ;
10081}
@@ -1077,7 +1058,6 @@ function describeConformance(
10771058 only = Object . keys ( fullSuite ) ,
10781059 slots,
10791060 skip = [ ] ,
1080- wrapMount,
10811061 } = getOptions ( ) ;
10821062
10831063 let filteredTests = Object . keys ( fullSuite ) . filter (
@@ -1092,21 +1072,11 @@ function describeConformance(
10921072 filteredTests = filteredTests . filter ( ( testKey ) => ! slotBasedTests . includes ( testKey ) ) ;
10931073 }
10941074
1095- const baseMount = createMount ( ) ;
1096- const mount = wrapMount !== undefined ? wrapMount ( baseMount ) : baseMount ;
1097-
10981075 after ( runAfterHook ) ;
10991076
1100- function getTestOptions ( ) : ConformanceOptions {
1101- return {
1102- ...getOptions ( ) ,
1103- mount,
1104- } ;
1105- }
1106-
11071077 filteredTests . forEach ( ( testKey ) => {
11081078 const test = fullSuite [ testKey ] ;
1109- test ( minimalElement , getTestOptions ) ;
1079+ test ( minimalElement , getOptions ) ;
11101080 } ) ;
11111081}
11121082
0 commit comments