@@ -3,7 +3,6 @@ import expect from 'expect';
33import React , { Component } from 'react' ;
44import ReactDOM from 'react-dom' ;
55import TestUtils from 'react-addons-test-utils' ;
6- import createReactClass from 'create-react-class' ;
76import Modal from '../src/components/Modal' ;
87import * as ariaAppHider from '../src/helpers/ariaAppHider' ;
98import {
@@ -57,7 +56,7 @@ describe('State', () => {
5756
5857 it ( 'renders into the body, not in context' , ( ) => {
5958 const node = document . createElement ( 'div' ) ;
60- const App = createReactClass ( {
59+ class App extends Component {
6160 render ( ) {
6261 return (
6362 < div >
@@ -67,7 +66,7 @@ describe('State', () => {
6766 </ div >
6867 ) ;
6968 }
70- } ) ;
69+ }
7170 Modal . setAppElement ( node ) ;
7271 ReactDOM . render ( < App /> , node ) ;
7372 expect (
@@ -357,22 +356,23 @@ describe('State', () => {
357356 const node = document . createElement ( 'div' ) ;
358357 let modal = null ;
359358
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+ }
364364
365365 componentDidMount ( ) {
366366 expect ( modal . node . className ) . toEqual ( 'myPortalClass' ) ;
367367
368368 this . setState ( {
369369 testHasChanged : true
370370 } ) ;
371- } ,
371+ }
372372
373373 componentDidUpdate ( ) {
374374 expect ( modal . node . className ) . toEqual ( 'myPortalClass-modifier' ) ;
375- } ,
375+ }
376376
377377 render ( ) {
378378 const portalClassName = this . state . testHasChanged === true ?
@@ -389,7 +389,7 @@ describe('State', () => {
389389 </ div >
390390 ) ;
391391 }
392- } ) ;
392+ }
393393
394394 Modal . setAppElement ( node ) ;
395395 ReactDOM . render ( < App /> , node ) ;
0 commit comments