@@ -105,7 +105,7 @@ import pandas as pd
105105value = 'hello world'` ;
106106 const basicCode2 : string = `value2 = 'hello world 2'` ;
107107
108- const mount = ioc . getInteractiveWebPanel ( undefined ) ;
108+ const { mount } = await getOrCreateInteractiveWindow ( ioc ) ;
109109 const wrapper = mount . wrapper ;
110110
111111 openVariableExplorer ( wrapper ) ;
@@ -172,7 +172,7 @@ value = 'hello world'`;
172172 const basicCode : string = `value = 'hello world'` ;
173173 const basicCode2 : string = `value2 = 'hello world 2'` ;
174174
175- const mount = ioc . getInteractiveWebPanel ( undefined ) ;
175+ const { mount } = await getOrCreateInteractiveWindow ( ioc ) ;
176176 const wrapper = mount . wrapper ;
177177
178178 openVariableExplorer ( wrapper ) ;
@@ -270,15 +270,16 @@ value = 'hello world'`;
270270 async ( ) => {
271271 const basicCode : string = `myList = [1, 2, 3]
272272mySet = set([42])
273- myDict = {'a': 1}` ;
273+ myDict = {'a': 1}
274+ myTuple = 1,2,3,4,5,6,7,8,9` ;
274275
275- const mount = ioc . getInteractiveWebPanel ( undefined ) ;
276+ const { mount } = await getOrCreateInteractiveWindow ( ioc ) ;
276277 const wrapper = mount . wrapper ;
277278
278279 openVariableExplorer ( wrapper ) ;
279280
280281 await addCodeImpartial ( wrapper , 'a=1\na' ) ;
281- await addCodeImpartial ( wrapper , basicCode , true ) ;
282+ await addCodeImpartial ( wrapper , basicCode , true , 2 ) ;
282283
283284 const targetVariables : IJupyterVariable [ ] = [
284285 {
@@ -322,6 +323,16 @@ myDict = {'a': 1}`;
322323 shape : '' ,
323324 count : 1 ,
324325 truncated : false
326+ } ,
327+ {
328+ name : 'myTuple' ,
329+ value : '(1, 2, 3, 4, 5, 6, 7, 8, 9)' ,
330+ supportsDataExplorer : false ,
331+ type : 'tuple' ,
332+ size : 54 ,
333+ shape : '9' ,
334+ count : 0 ,
335+ truncated : false
325336 }
326337 ] ;
327338 verifyVariables ( wrapper , targetVariables ) ;
@@ -371,9 +382,8 @@ myFloat = 9999.9999
371382mynpArray = np.array([1.0, 2.0, 3.0])
372383myDataframe = pd.DataFrame(mynpArray)
373384mySeries = myDataframe[0]
374- myTuple = 1,2,3,4,5,6,7,8,9
375385` ;
376- const mount = ioc . getInteractiveWebPanel ( undefined ) ;
386+ const { mount } = await getOrCreateInteractiveWindow ( ioc ) ;
377387 const wrapper = mount . wrapper ;
378388
379389 openVariableExplorer ( wrapper ) ;
@@ -449,16 +459,6 @@ Name: 0, dtype: float64`,
449459 count : 0 ,
450460 truncated : false
451461 } ,
452- {
453- name : 'myTuple' ,
454- value : '(1, 2, 3, 4, 5, 6, 7, 8, 9)' ,
455- supportsDataExplorer : false ,
456- type : 'tuple' ,
457- size : 54 ,
458- shape : '9' ,
459- count : 0 ,
460- truncated : false
461- } ,
462462 {
463463 name : 'mynpArray' ,
464464 value : '[1. 2. 3.]' ,
@@ -474,7 +474,7 @@ Name: 0, dtype: float64`,
474474
475475 // Step into the first cell over again. Should have the same variables
476476 if ( runByLine ) {
477- targetVariables [ 7 ] . value = 'array([1., 2., 3.])' ; // Debugger shows np array differently
477+ targetVariables [ 6 ] . value = 'array([1., 2., 3.])' ; // Debugger shows np array differently
478478 await verifyAfterStep ( ioc , wrapper , ( ) => {
479479 verifyVariables ( wrapper , targetVariables ) ;
480480 return Promise . resolve ( ) ;
@@ -512,7 +512,7 @@ Name: 0, dtype: float64`,
512512 const basicCode : string = `for _i in range(1050):
513513 exec("var{}=[{} ** 2 % 17 for _l in range(100000)]".format(_i, _i))` ;
514514
515- const mount = t === 'native' ? ioc . getNativeWebPanel ( undefined ) : ioc . getInteractiveWebPanel ( undefined ) ;
515+ const { mount } = t === 'native' ? await createNewEditor ( ioc ) : await getOrCreateInteractiveWindow ( ioc ) ;
516516 const wrapper = mount . wrapper ;
517517 openVariableExplorer ( wrapper ) ;
518518
@@ -523,13 +523,11 @@ Name: 0, dtype: float64`,
523523 . map ( generateVar )
524524 . sort ( ( a : IJupyterVariable , b : IJupyterVariable ) => a . name . localeCompare ( b . name ) ) ;
525525
526- const targetVariables = allVariables . slice ( 0 , 16 ) ;
526+ const targetVariables = allVariables . slice ( 0 , 14 ) ;
527527 verifyVariables ( wrapper , targetVariables ) ;
528528
529529 // Force a scroll to the bottom
530- const complete = mount . waitForMessage ( InteractiveWindowMessages . VariablesComplete , {
531- numberOfTimes : 2
532- } ) ;
530+ const complete = mount . waitForMessage ( InteractiveWindowMessages . VariablesComplete ) ;
533531 const grid = wrapper . find ( AdazzleReactDataGrid ) ;
534532 const viewPort = grid . find ( 'Viewport' ) . instance ( ) ;
535533 const rowHeight = ( viewPort . props as any ) . rowHeight as number ;
@@ -540,7 +538,7 @@ Name: 0, dtype: float64`,
540538 await complete ;
541539
542540 // Now we should have the bottom. For some reason only 10 come back here.
543- const bottomVariables = allVariables . slice ( 1041 , 1051 ) ;
541+ const bottomVariables = allVariables . slice ( 1041 , 1050 ) ;
544542 verifyVariables ( wrapper , bottomVariables ) ;
545543
546544 // Step into the first cell over again. Should have the same variables
@@ -550,15 +548,15 @@ Name: 0, dtype: float64`,
550548 . map ( ( v ) => {
551549 return { ...v , value : undefined } ;
552550 } )
553- . slice ( 0 , 10 ) ;
551+ . slice ( 0 , 9 ) ;
554552 await verifyAfterStep (
555553 ioc ,
556554 wrapper ,
557555 ( ) => {
558556 verifyVariables ( wrapper , nonValued ) ;
559557 return Promise . resolve ( ) ;
560558 } ,
561- 3 // 3 refreshes because the variable explorer is scrolled to the bottom.
559+ 2 // 2 refreshes because the variable explorer is scrolled to the bottom.
562560 ) ;
563561 }
564562 } ,
@@ -576,7 +574,8 @@ mynpArray = np.array([1.0, 2.0, 3.0])
576574myDataframe = pd.DataFrame(mynpArray)
577575mySeries = myDataframe[0]
578576` ;
579- const wrapper = ioc . getInteractiveWebPanel ( undefined ) . wrapper ;
577+ const { mount } = await getOrCreateInteractiveWindow ( ioc ) ;
578+ const wrapper = mount . wrapper ;
580579
581580 openVariableExplorer ( wrapper ) ;
582581
0 commit comments