Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.8k
Fix stale[*] execution indicator on undo#18173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1961,6 +1961,46 @@ | ||
| NotebookActions.undo(widget); | ||
| expect(widget.widgets.length).toBe(count-1); | ||
| }); | ||
| it('should reset execution state to idle after undoing a merge',()=>{ | ||
| constcell=widget.widgets[0]asCodeCell; | ||
| widget.activeCellIndex=0; | ||
| constinitialSource='line1\nline2'; | ||
| cell.model.sharedModel.setSource(initialSource); | ||
| // Simulate running cell | ||
| cell.model.sharedModel.executionState='running'; | ||
| // Split the first cell | ||
| consteditor=cell.editorasCodeEditor.IEditor; | ||
| widget.activeCellIndex=0; | ||
| editor.setCursorPosition(editor.getPositionAt(6)!);// Split after 'line1' | ||
| NotebookActions.splitCell(widget); | ||
| constfirstSplitCell=widget.widgets[0]asCodeCell; | ||
| constsecondSplitCell=widget.widgets[1]asCodeCell; | ||
| expect(firstSplitCell.model.sharedModel.getSource()).toBe('line1'); | ||
| expect(secondSplitCell.model.sharedModel.getSource()).toBe('line2'); | ||
| expect(firstSplitCell.model.sharedModel.executionState).toBe('idle'); | ||
| expect(secondSplitCell.model.sharedModel.executionState).toBe( | ||
| 'running' | ||
| ); | ||
| // Merge cells | ||
| widget.activeCellIndex=0; | ||
| NotebookActions.mergeCells(widget,false,false); | ||
| constmergedCell=widget.widgets[0]asCodeCell; | ||
| expect(mergedCell.model.sharedModel.getSource()).toBe(initialSource); | ||
| expect(mergedCell.model.sharedModel.executionState).toBe('idle'); | ||
| // Undo the merge (which splits the cells again) | ||
| NotebookActions.undo(widget); | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Not sure why this | ||
| constfirstCellAfterUndo=widget.widgets[0]asCodeCell; | ||
| constsecondCellAfterUndo=widget.widgets[1]asCodeCell; | ||
| expect(firstCellAfterUndo.model.sharedModel.getSource()).toBe('line1'); | ||
Check failure on line 1995 in packages/notebook/test/actions.spec.ts
| ||
| expect(secondCellAfterUndo.model.sharedModel.getSource()).toBe('line2'); | ||
| expect(firstCellAfterUndo.model.sharedModel.executionState).toBe( | ||
| 'idle' | ||
| ); | ||
| expect(secondCellAfterUndo.model.sharedModel.executionState).toBe( | ||
| 'idle' | ||
| ); | ||
| }); | ||
| }); | ||
| describe('#redo()',()=>{ | ||
Uh oh!
There was an error while loading.Please reload this page.