-
Notifications
You must be signed in to change notification settings - Fork 1.3k
More functional tests for the notebook editor #7804
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Make sure when an error occurs on running a cell it's displayed to the user.
Codecov Report
@@ Coverage Diff @@
## master #7804 +/- ##
==========================================
+ Coverage 59.15% 59.15% +<.01%
==========================================
Files 498 498
Lines 22254 22256 +2
Branches 3578 3579 +1
==========================================
+ Hits 13164 13166 +2
Misses 8266 8266
Partials 824 824
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some comments and possibly displaying errors in native editor before handling error might help.
await this.errorHandler.handleError(exc); | ||
|
||
// Make this error our cell output | ||
this.sendCellsToWebView([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not send the error message to the view then display the error message (e.g. errorHandler.handleError
could end up displaying another UI, and its good to have the errors already visible in the native editor at that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
public resetLoad() { | ||
this.waitingForLoadRender = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this method do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rests the state of loading so that the tests can reload the same control over again. I'll add a comment. reset sounds like a better name
In reply to: 332271637 [](ancestors = 332271637)
export function closeNotebook(editor: INotebookEditor, wrapper: ReactWrapper<any, Readonly<{}>, React.Component>): Promise<void> { | ||
const reactEditor = getMainPanel<NativeEditor>(wrapper, NativeEditor); | ||
if (reactEditor) { | ||
reactEditor.stateController.resetLoad(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're closing an editor, then why call it resetLoad
, why not reset
or dispose
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dispose isn't appropriate as the react control is still active. But reset works.
In reply to: 332272623 [](ancestors = 332272623)
* New tests * Add some more functional tests for the notebook editor Make sure when an error occurs on running a cell it's displayed to the user. * Review feedback
For #7372
Provide some error checking around server not running.
Also fixed the code so that if an error occurs during startup, we show the error in the output of the first cell.