@@ -12,7 +12,6 @@ jest.mock('./ImportedComponent', () => 'ImportedComponent');
1212jest . mock ( './hooks' , ( ) => ( { __esModule : true , default : jest . fn ( ) } ) ) ;
1313
1414let el ;
15- let inst ;
1615let hookProps ;
1716describe ( 'ExampleComponent component' , ( ) => {
1817 beforeAll ( ( ) => {
@@ -36,23 +35,20 @@ describe('ExampleComponent component', () => {
3635 expect ( el . snapshot ) . toMatchSnapshot ( ) ;
3736 } ) ;
3837 describe ( 'output' , ( ) => {
39- beforeEach ( ( ) => {
40- inst = el . instance ;
41- } ) ;
4238 test ( 'Form' , ( ) => {
43- const control = inst . findByType ( Form ) [ 0 ] ;
39+ const control = el . instance . findByType ( Form ) [ 0 ] ;
4440 expect ( control . props . action ) . toEqual ( hookProps . formAction ) ;
4541 } ) ;
4642 test ( 'FileControl' , ( ) => {
47- const control = inst . findByTestId ( testIds . fileControl ) [ 0 ] ;
43+ const control = el . instance . findByTestId ( testIds . fileControl ) [ 0 ] ;
4844 expect ( control . props . onChange ) . toEqual ( hookProps . handleFileInputChange ) ;
4945 } ) ;
5046 test ( 'imported component' , ( ) => {
51- const control = inst . findByType ( ImportedComponent ) [ 0 ] ;
47+ const control = el . instance . findByType ( ImportedComponent ) [ 0 ] ;
5248 expect ( control . props . onClick ) . toEqual ( hookProps . handleClickImportedComponent ) ;
5349 } ) ;
5450 test ( 'random' , ( ) => {
55- const control = inst . findByType ( 'div' ) [ 0 ] ;
51+ const control = el . instance . findByType ( 'div' ) [ 0 ] ;
5652 expect ( control . matches ( shallow (
5753 < div >
5854 < h1 > { formatMessage ( messages . heading ) } </ h1 >
0 commit comments