1111
1212'use strict' ;
1313
14+ var React = require ( 'react' ) ;
15+ var ReactDOM = require ( 'react-dom' ) ;
16+ var ReactTestUtils = require ( 'ReactTestUtils' ) ;
17+ var ReactInputSelection = require ( 'ReactInputSelection' ) ;
18+
1419describe ( 'ReactInputSelection' , ( ) => {
15- var React ;
16- var ReactDOM ;
17- var ReactTestUtils ;
18- var ReactInputSelection ;
1920 var textValue = 'the text contents' ;
2021 var createAndMountElement = ( type , props , children ) => {
2122 var element = React . createElement ( type , props , children ) ;
@@ -29,15 +30,6 @@ describe('ReactInputSelection', () => {
2930 focusOffset : win . document . activeElement && win . document . activeElement . selectionEnd ,
3031 } ) ;
3132
32- beforeEach ( ( ) => {
33- jest . resetModuleRegistry ( ) ;
34-
35- React = require ( 'React' ) ;
36- ReactDOM = require ( 'ReactDOM' ) ;
37- ReactTestUtils = require ( 'ReactTestUtils' ) ;
38- ReactInputSelection = require ( 'ReactInputSelection' ) ;
39- } ) ;
40-
4133 describe ( 'hasSelectionCapabilities' , ( ) => {
4234 it ( 'returns true for textareas' , ( ) => {
4335 var textarea = document . createElement ( 'textarea' ) ;
@@ -203,7 +195,8 @@ describe('ReactInputSelection', () => {
203195 input . selectionStart = 1 ;
204196 input . selectionEnd = 10 ;
205197 var selectionInfo = ReactInputSelection . getSelectionInformation ( ) ;
206- expect ( selectionInfo . focusedElement ) . toBe ( input ) ;
198+ console . log ( selectionInfo . focusedElement ) ;
199+ expect ( selectionInfo . focusedElement === input ) . toBe ( true ) ;
207200 expect ( selectionInfo . activeElements [ 0 ] . selectionRange ) . toEqual ( { start : 1 , end : 10 } ) ;
208201 expect ( document . activeElement ) . toBe ( iframe ) ;
209202 expect ( iframeDoc . activeElement ) . toBe ( input ) ;
0 commit comments