Skip to content

Commit ff75df4

Browse files
committed
adjust test and update schema
1 parent 1739f3d commit ff75df4

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

test/jasmine/bundle_tests/mathjax_config_test.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
var Plotly = require('@lib/index');
44

5+
var delay = require('../assets/delay');
56
var createGraphDiv = require('../assets/create_graph_div');
67
var destroyGraphDiv = require('../assets/destroy_graph_div');
78
var loadScript = require('../assets/load_script');
@@ -48,12 +49,12 @@ describe('Test MathJax v' + mathjaxVersion + ' config test:', function() {
4849

4950
// before plot
5051
if(mathjaxVersion === 3) {
51-
expect(window.MathJax.config.startup.tex.inlineMath).toEqual([['|', '|']]);
5252
expect(window.MathJax.config.startup.output).toEqual('chtml');
53+
expect(window.MathJax.config.startup.tex.inlineMath).toEqual([['|', '|']]);
5354
}
5455
if(mathjaxVersion === 2) {
55-
expect(window.MathJax.Hub.config.tex2jax.inlineMath).toEqual([['|', '|']]);
5656
expect(window.MathJax.Hub.config.menuSettings.renderer).toEqual('');
57+
expect(window.MathJax.Hub.config.tex2jax.inlineMath).toEqual([['|', '|']]);
5758
}
5859

5960
Plotly.newPlot(gd, {
@@ -69,15 +70,19 @@ describe('Test MathJax v' + mathjaxVersion + ' config test:', function() {
6970
.then(function() {
7071
// after plot
7172
if(mathjaxVersion === 3) {
72-
expect(window.MathJax.config.startup.tex.inlineMath).toEqual([['|', '|']]);
7373
expect(window.MathJax.config.startup.output).toEqual('chtml');
74+
expect(window.MathJax.config.startup.tex.inlineMath).toEqual([['|', '|']]);
7475
}
7576
if(mathjaxVersion === 2) {
76-
// TODO: figure out why v2 implementation does not reset inlineMath
77-
// expect(window.MathJax.Hub.config.tex2jax.inlineMath).toEqual([['|', '|']]);
7877
expect(window.MathJax.Hub.config.menuSettings.renderer).toEqual('');
7978
}
8079
})
80+
.then(delay(1000)) // TODO: why we need this delay for mathjax v2 here?
81+
.then(function() {
82+
if(mathjaxVersion === 2) {
83+
expect(window.MathJax.Hub.config.tex2jax.inlineMath).toEqual([['|', '|']]);
84+
}
85+
})
8186
.then(done, done.fail);
8287
});
8388
});

test/plot-schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366
"valType": "string"
367367
},
368368
"typesetMath": {
369-
"description": "Determines whether the math should be typeset or not.",
369+
"description": "Determines whether math should be typeset or not, when MathJax (either v2 or v3) is present on the page.",
370370
"dflt": true,
371371
"valType": "boolean"
372372
},

0 commit comments

Comments
 (0)