11import { assert } from 'chai' ;
22import React from 'react' ;
3+ import testRef from './testRef' ;
34
45/**
56 * Glossary
@@ -95,17 +96,13 @@ function testPropsSpread(element, getOptions) {
9596 * @param {React.ReactElement } element
9697 * @param {() => ConformanceOptions } getOptions
9798 */
98- function testRef ( element , getOptions ) {
99+ function describeRef ( element , getOptions ) {
99100 describe ( 'ref' , ( ) => {
100101 it ( `attaches the ref` , ( ) => {
101102 // type def in ConformanceOptions
102103 const { mount, refInstanceof } = getOptions ( ) ;
103104
104- const ref = React . createRef ( ) ;
105- // TODO use `ref` once `WithStylesTest` is removed
106- mount ( React . cloneElement ( element , { innerRef : ref } ) ) ;
107-
108- assert . instanceOf ( ref . current , refInstanceof ) ;
105+ testRef ( element , mount , current => assert . instanceOf ( current , refInstanceof ) ) ;
109106 } ) ;
110107 } ) ;
111108}
@@ -114,7 +111,7 @@ const fullSuite = {
114111 class : testClassName ,
115112 componentProp : testComponentProp ,
116113 propsSpread : testPropsSpread ,
117- refForwarding : testRef ,
114+ refForwarding : describeRef ,
118115} ;
119116
120117/**
0 commit comments