File tree Expand file tree Collapse file tree 3 files changed +35
-8
lines changed Expand file tree Collapse file tree 3 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -150,9 +150,6 @@ var Shared = (function () {
150150 } ) ;
151151 }
152152 break ;
153- default : {
154- break ;
155- }
156153 }
157154 } ;
158155 return Shared ;
Original file line number Diff line number Diff line change @@ -222,9 +222,6 @@ class Shared implements ICommon {
222222 } ) ;
223223 }
224224 break ;
225- default : {
226- break ;
227- }
228225 }
229226 }
230227}
Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ import {Controlled, UnControlled} from '../src';
88Enzyme . configure ( { adapter : new Adapter ( ) } ) ;
99
1010global . console = {
11- warn : jest . fn ( )
12- }
11+ warn : jest . fn ( ) ,
12+ log : console . log
13+ } ;
1314
1415describe ( '[temporary] deprecation notice' , ( ) => {
1516
@@ -327,4 +328,36 @@ describe('Props', () => {
327328 } } />
328329 ) ;
329330 } ) ;
331+
332+ it ( '[Controlled]: autoFocus' , ( ) => {
333+ let wrapper = Enzyme . mount (
334+ < Controlled
335+ value = 'foo'
336+ autoFocus = { true }
337+ cursor = { {
338+ line : 0 ,
339+ ch : 3
340+ } } />
341+ ) ;
342+
343+ let editor = wrapper . instance ( ) . editor ;
344+
345+ expect ( editor . state . focused ) . toBe ( true )
346+ } ) ;
347+
348+ it ( '[UnControlled]: autoFocus' , ( ) => {
349+ let wrapper = Enzyme . mount (
350+ < UnControlled
351+ value = 'foo'
352+ autoFocus = { true }
353+ cursor = { {
354+ line : 0 ,
355+ ch : 3
356+ } } />
357+ ) ;
358+
359+ let editor = wrapper . instance ( ) . editor ;
360+
361+ expect ( editor . state . focused ) . toBe ( true )
362+ } ) ;
330363} ) ;
You can’t perform that action at this time.
0 commit comments