-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When a description changed, update the latex rendering. Similar to voila-dashboards/voila#531
- Loading branch information
1 parent
fb8884d
commit e0b1720
Showing
6 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import ipywidgets as widgets | ||
import playwright.sync_api | ||
from IPython.display import display | ||
|
||
|
||
def test_widget_latex_solara(solara_test, page_session: playwright.sync_api.Page, assert_solara_snapshot): | ||
# we tried a FloatSlider before, but that seems to give unstable images (handle moves around randomly) | ||
label = widgets.Label(value=r"$E \sim mc^2$") | ||
label.add_class("test-class-latex") | ||
display(label) | ||
|
||
page_session.locator(".test-class-latex >> .mjx-c1D438").wait_for() | ||
page_session.evaluate("document.fonts.ready") | ||
page_session.wait_for_timeout(100) | ||
assert_solara_snapshot(page_session.locator(".test-class-latex >> .MathJax").screenshot()) | ||
label.value = r"$\alpha$" | ||
label.add_class("test-changed-class-latex") | ||
page_session.locator(".test-changed-class-latex >> .mjx-c1D6FC").wait_for() | ||
page_session.evaluate("document.fonts.ready") | ||
page_session.wait_for_timeout(100) | ||
assert_solara_snapshot(page_session.locator(".test-changed-class-latex >> .MathJax").screenshot(), postfix="-changed") |
Binary file added
BIN
+315 Bytes
...tex_test.py/test_widget_latex_solara-flask-chromium-linux-changed-reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.06 KB
...ation/latex_test.py/test_widget_latex_solara-flask-chromium-linux-reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+315 Bytes
...test.py/test_widget_latex_solara-starlette-chromium-linux-changed-reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.06 KB
...n/latex_test.py/test_widget_latex_solara-starlette-chromium-linux-reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.