@@ -3,7 +3,6 @@ import expect from 'expect';
3
3
import React , { Component } from 'react' ;
4
4
import ReactDOM from 'react-dom' ;
5
5
import TestUtils from 'react-addons-test-utils' ;
6
- import createReactClass from 'create-react-class' ;
7
6
import Modal from '../src/components/Modal' ;
8
7
import * as ariaAppHider from '../src/helpers/ariaAppHider' ;
9
8
import {
@@ -57,7 +56,7 @@ describe('State', () => {
57
56
58
57
it ( 'renders into the body, not in context' , ( ) => {
59
58
const node = document . createElement ( 'div' ) ;
60
- const App = createReactClass ( {
59
+ class App extends Component {
61
60
render ( ) {
62
61
return (
63
62
< div >
@@ -67,7 +66,7 @@ describe('State', () => {
67
66
</ div >
68
67
) ;
69
68
}
70
- } ) ;
69
+ }
71
70
Modal . setAppElement ( node ) ;
72
71
ReactDOM . render ( < App /> , node ) ;
73
72
expect (
@@ -357,22 +356,23 @@ describe('State', () => {
357
356
const node = document . createElement ( 'div' ) ;
358
357
let modal = null ;
359
358
360
- const App = createReactClass ( {
361
- getInitialState ( ) {
362
- return { testHasChanged : false } ;
363
- } ,
359
+ class App extends Component {
360
+ constructor ( props ) {
361
+ super ( props ) ;
362
+ this . state = { testHasChanged : false } ;
363
+ }
364
364
365
365
componentDidMount ( ) {
366
366
expect ( modal . node . className ) . toEqual ( 'myPortalClass' ) ;
367
367
368
368
this . setState ( {
369
369
testHasChanged : true
370
370
} ) ;
371
- } ,
371
+ }
372
372
373
373
componentDidUpdate ( ) {
374
374
expect ( modal . node . className ) . toEqual ( 'myPortalClass-modifier' ) ;
375
- } ,
375
+ }
376
376
377
377
render ( ) {
378
378
const portalClassName = this . state . testHasChanged === true ?
@@ -389,7 +389,7 @@ describe('State', () => {
389
389
</ div >
390
390
) ;
391
391
}
392
- } ) ;
392
+ }
393
393
394
394
Modal . setAppElement ( node ) ;
395
395
ReactDOM . render ( < App /> , node ) ;
0 commit comments