Skip to content

Commit 471197e

Browse files
committed
take MathJax out of annotations mock - but still test the fallback in Jasmine
1 parent 033bee3 commit 471197e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

test/image/baselines/annotations.png

-3.41 KB
Loading

test/image/mocks/annotations.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{"text":"no arrow<br>page auto BC","showarrow":false,"xref":"paper","yref":"paper","x":0.5,"y":0.25},
2727
{"text":"default"},
2828
{"text":"no arrow","x":5,"y":4,"showarrow":false},
29-
{"text":"$x+y+z+q$","showarrow":false,"bordercolor":"rgb(148, 103, 189)","x":4,"y":3},
29+
{"text":"border","showarrow":false,"bordercolor":"rgb(148, 103, 189)","x":4,"y":3},
3030
{"text":"border width","showarrow":false,"bordercolor":"rgb(0, 0, 255)","borderwidth":3,"x":5,"y":3},
3131
{"text":"background","showarrow":false,"bgcolor":"rgb(255, 127, 14)","x":4,"y":2},
3232
{"text":"padding","showarrow":false,"bordercolor":"rgb(0, 0, 0)","borderpad":3,"x":5,"y":2},
@@ -54,10 +54,6 @@
5454
"text": "angle, arrow TR<br>box+standoff", "x": 2, "y": 2, "ax": -20, "ay": -20,
5555
"xanchor": "right", "yanchor": "top", "standoff": 5, "textangle": 45, "bordercolor": "#444"
5656
},
57-
{
58-
"text": "$\\sqrt{42 \\pm \\Omega^2}$", "bordercolor": "#0c0", "x": 1, "y": 2,
59-
"ax": 0, "ay": -20, "yanchor": "bottom", "textangle": -30
60-
},
6157
{"text": "off-plot, do not show!", "x": 5.1, "y": 3.5, "showarrow": false},
6258
{"text": "off-plot 2", "x": 3, "y": 5.1, "showarrow": true, "ax": 0, "ay": 100}
6359
]

test/jasmine/tests/annotations_test.js

+6
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ describe('annotations relayout', function() {
159159
var mockData = Lib.extendDeep([], mock.data),
160160
mockLayout = Lib.extendDeep({}, mock.layout);
161161

162+
// insert some MathJax text - to make sure we fall back correctly
163+
// when MathJax is not provided (as is the case in our normal
164+
// jasmine test suite)
165+
expect(typeof MathJax).toBe('undefined');
166+
mockLayout.annotations[14].text = '$x+y+z$';
167+
162168
Plotly.plot(gd, mockData, mockLayout).then(done);
163169

164170
spyOn(Loggers, 'warn');

0 commit comments

Comments
 (0)