Skip to content

Commit f1722f4

Browse files
Fix mathjax default url and bump ipywidgets packages (#1496)
* Fix default mathjax url * Bump ipywidgets * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix ui-tests * More visual regression fixes * Yarn f***** dedupe --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e075199 commit f1722f4

File tree

6 files changed

+496
-521
lines changed

6 files changed

+496
-521
lines changed

packages/voila/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
},
1212
"browserslist": ">0.8%, not ie 11, not op_mini all, not dead",
1313
"dependencies": {
14-
"@jupyter-widgets/base": "^6.0.6",
15-
"@jupyter-widgets/jupyterlab-manager": "^5.0.9",
14+
"@jupyter-widgets/base": "^6.0.10",
15+
"@jupyter-widgets/jupyterlab-manager": "^5.0.13",
1616
"@jupyterlab/application": "^4.0.0",
1717
"@jupyterlab/apputils": "^4.0.0",
1818
"@jupyterlab/apputils-extension": "^4.0.0",

packages/voila/src/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function shouldUseMathJax2() {
9090
PageConfig.setOption(
9191
urlParam,
9292
url === 'null'
93-
? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js'
93+
? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/latest.min.js'
9494
: url
9595
);
9696
PageConfig.setOption(

ui-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Voila UI Tests",
55
"private": true,
66
"scripts": {
7-
"start": "voila ../notebooks --no-browser --show_tracebacks True --Voila.mathjax_url=https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js",
7+
"start": "voila ../notebooks --no-browser --show_tracebacks True",
88
"start:detached": "yarn run start&",
99
"test": "npx playwright test",
1010
"test:debug": "PWDEBUG=1 playwright test",

ui-tests/tests/voila.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test.describe('Voila performance Tests', () => {
8383
const testFunction = async () => {
8484
await page.goto(`/voila/render/${notebookName}.ipynb?template=classic`);
8585
// wait for the widgets to load
86-
await page.waitForSelector('span[role="presentation"] >> text=x');
86+
await page.waitForSelector('.slider-container');
8787
};
8888
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);
8989

@@ -103,7 +103,7 @@ test.describe('Voila performance Tests', () => {
103103
const testFunction = async () => {
104104
await page.goto(`/voila/render/${notebookName}.ipynb`);
105105
// wait for the widgets to load
106-
await page.waitForSelector('span.mjx-char >> text=x');
106+
await page.waitForSelector('.slider-container');
107107
};
108108
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);
109109
// change the value of the slider
@@ -128,7 +128,7 @@ test.describe('Voila performance Tests', () => {
128128
const testFunction = async () => {
129129
await page.goto(`/voila/render/${notebookName}.ipynb?theme=dark`);
130130
// wait for the widgets to load
131-
await page.waitForSelector('span[role="presentation"] >> text=x');
131+
await page.waitForSelector('.slider-container');
132132
};
133133
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);
134134

@@ -148,7 +148,7 @@ test.describe('Voila performance Tests', () => {
148148
`/voila/render/${notebookName}.ipynb?theme=JupyterLab%20Miami%20Nights`
149149
);
150150
// wait for the widgets to load
151-
await page.waitForSelector('span[role="presentation"] >> text=x');
151+
await page.waitForSelector('.slider-container');
152152
};
153153
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);
154154

@@ -334,7 +334,7 @@ test.describe('Voila performance Tests', () => {
334334
const notebookName = 'reveal';
335335
const testFunction = async () => {
336336
await page.goto(`/voila/render/${notebookName}.ipynb`);
337-
await page.waitForSelector('span[role="presentation"] >> text=x');
337+
await page.waitForSelector('.slider-container');
338338
};
339339
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);
340340
expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`);

voila/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def get_page_config(base_url, settings, log, voila_configuration: VoilaConfigura
102102
}
103103
mathjax_config = settings.get("mathjax_config", "TeX-AMS_CHTML-full,Safe")
104104
mathjax_url = settings.get(
105-
"mathjax_url", "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js"
105+
"mathjax_url",
106+
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/latest.min.js",
106107
)
107108
page_config.setdefault("mathjaxConfig", mathjax_config)
108109
page_config.setdefault("fullMathjaxUrl", mathjax_url)

0 commit comments

Comments
 (0)