Skip to content

Commit

Permalink
Improve JS Test Docs for macOS and Fix Flaky Test (#320)
Browse files Browse the repository at this point in the history
* Add note for Rosetta needed

* Fix img is not defined
  • Loading branch information
danyeaw authored Feb 13, 2025
1 parent 25a8c56 commit 21d390e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ or to run just ``nbclassic/tests/notebook/deletecell.js``::

python -m nbclassic.jstest notebook/deletecell.js

.. note::
If you are getting spawn errors with an ARM Mac on macOS, make sure you
have Rosetta installed.


Building the Documentation
--------------------------
Expand Down
9 changes: 9 additions & 0 deletions nbclassic/tests/notebook/attachments.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ casper.notebook_test(function () {

// Validate and render the markdown cell
this.thenClick('#btn_ok');

// Wait for cell content to update before rendering
this.waitFor(function() {
return this.evaluate(function() {
var cell = Jupyter.notebook.get_cell(0);
return cell.get_text().indexOf('![') >= 0;
});
});

this.thenEvaluate(function() {
Jupyter.notebook.get_cell(0).render();
});
Expand Down

0 comments on commit 21d390e

Please sign in to comment.