@@ -438,6 +438,27 @@ suite('notebook workflow', () => {
438438 await vscode . commands . executeCommand ( 'workbench.action.closeActiveEditor' ) ;
439439 } ) ;
440440
441+ test ( 'notebook join cells' , async function ( ) {
442+ const resource = vscode . Uri . file ( join ( vscode . workspace . rootPath || '' , './first.vsctestnb' ) ) ;
443+ await vscode . commands . executeCommand ( 'vscode.openWith' , resource , 'notebookCoreTest' ) ;
444+ assert . equal ( vscode . notebook . activeNotebookEditor !== undefined , true , 'notebook first' ) ;
445+ assert . equal ( vscode . notebook . activeNotebookEditor ! . selection ?. document . getText ( ) , 'test' ) ;
446+ assert . equal ( vscode . notebook . activeNotebookEditor ! . selection ?. language , 'typescript' ) ;
447+
448+ await vscode . commands . executeCommand ( 'notebook.cell.insertCodeCellBelow' ) ;
449+ assert . equal ( vscode . notebook . activeNotebookEditor ! . selection ?. document . getText ( ) , '' ) ;
450+ await vscode . commands . executeCommand ( 'default:type' , { text : 'var abc = 0;' } ) ;
451+
452+ const cellsChangeEvent = getEventOncePromise < vscode . NotebookCellsChangeEvent > ( vscode . notebook . onDidChangeNotebookCells ) ;
453+ await vscode . commands . executeCommand ( 'notebook.cell.joinAbove' ) ;
454+ await cellsChangeEvent ;
455+
456+ assert . deepEqual ( vscode . notebook . activeNotebookEditor ! . selection ?. document . getText ( ) . split ( / \r | \n | \r \n / ) , [ 'test' , 'var abc = 0;' ] ) ;
457+
458+ await vscode . commands . executeCommand ( 'workbench.action.files.save' ) ;
459+ await vscode . commands . executeCommand ( 'workbench.action.closeActiveEditor' ) ;
460+ } ) ;
461+
441462 test ( 'move cells will not recreate cells in ExtHost' , async function ( ) {
442463 const resource = vscode . Uri . file ( join ( vscode . workspace . rootPath || '' , './first.vsctestnb' ) ) ;
443464 await vscode . commands . executeCommand ( 'vscode.openWith' , resource , 'notebookCoreTest' ) ;
0 commit comments