Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f2c6f14

Browse files
committed
drop IE from jasmine tests
1 parent b997879 commit f2c6f14

File tree

5 files changed

+1
-109
lines changed

5 files changed

+1
-109
lines changed

test/jasmine/assets/unpolyfill.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

test/jasmine/karma.conf.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ if(isFullSuite) {
118118
}
119119

120120
var pathToCustomMatchers = path.join(__dirname, 'assets', 'custom_matchers.js');
121-
var pathToUnpolyfill = path.join(__dirname, 'assets', 'unpolyfill.js');
122121
var pathToSaneTopojsonDist = path.join(__dirname, '..', '..', 'node_modules', 'sane-topojson', 'dist');
123122
var pathToMathJax2 = path.join(__dirname, '..', '..', 'node_modules', 'mathjax-v2');
124123
var pathToMathJax3 = path.join(__dirname, '..', '..', 'node_modules', 'mathjax-v3');
@@ -189,7 +188,6 @@ func.defaultConfig = {
189188
// N.B. the rest of this field is filled below
190189
files: [
191190
pathToCustomMatchers,
192-
pathToUnpolyfill,
193191
// available to fetch from /base/node_modules/mathjax-v2/
194192
// more info: http://karma-runner.github.io/3.0/config/files.html
195193
{pattern: pathToMathJax2 + '/**', included: false, watched: false, served: true},

test/jasmine/tests/download_test.js

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -86,54 +86,6 @@ describe('Plotly.downloadImage', function() {
8686
})
8787
.then(done, done.fail);
8888
}, LONG_TIMEOUT_INTERVAL);
89-
90-
it('should produce the right SVG output in IE', function(done) {
91-
// mock up IE behavior
92-
spyOn(Lib, 'isIE').and.callFake(function() { return true; });
93-
spyOn(slzProto, 'serializeToString').and.callFake(function() {
94-
return serializeToString.apply(this, arguments)
95-
.replace(/(\(#)([^")]*)(\))/gi, '(\"#$2\")');
96-
});
97-
var savedBlob;
98-
window.navigator.msSaveBlob = function(blob) { savedBlob = blob; };
99-
100-
var expectedStart = '<svg class=\'main-svg\' xmlns=\'http://www.w3.org/2000/svg\' xmlns:xlink=\'http://www.w3.org/1999/xlink\'';
101-
var plotClip = /clip-path='url\("#clip[0-9a-f]{6}xyplot"\)/;
102-
var legendClip = /clip-path=\'url\("#legend[0-9a-f]{6}"\)/;
103-
104-
Plotly.newPlot(gd, textchartMock.data, textchartMock.layout)
105-
.then(function(gd) {
106-
savedBlob = undefined;
107-
return Plotly.downloadImage(gd, {
108-
format: 'svg',
109-
height: 300,
110-
width: 300,
111-
filename: 'plotly_download'
112-
});
113-
})
114-
.then(function() {
115-
if(savedBlob === undefined) {
116-
fail('undefined saveBlob');
117-
}
118-
119-
return new Promise(function(resolve, reject) {
120-
var reader = new FileReader();
121-
reader.onloadend = function() {
122-
var res = reader.result;
123-
124-
expect(res.substr(0, expectedStart.length)).toBe(expectedStart);
125-
expect(res.match(plotClip)).not.toBe(null);
126-
expect(res.match(legendClip)).not.toBe(null);
127-
128-
resolve();
129-
};
130-
reader.onerror = function(e) { reject(e); };
131-
132-
reader.readAsText(savedBlob);
133-
});
134-
})
135-
.then(done, done.fail);
136-
}, LONG_TIMEOUT_INTERVAL);
13789
});
13890

13991
function downloadTest(gd, format) {

test/jasmine/tests/lib_test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,9 +1853,7 @@ describe('Test lib.js:', function() {
18531853
-Number.MAX_VALUE, -Number.MIN_VALUE
18541854
];
18551855

1856-
if(!Lib.isIE()) {
1857-
vals.push(Number.EPSILON, -Number.EPSILON);
1858-
}
1856+
vals.push(Number.EPSILON, -Number.EPSILON);
18591857

18601858
vals.forEach(function(v) {
18611859
expect(Lib.cleanNumber(v)).toBe(v);

test/jasmine/tests/svg_text_utils_test.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -349,28 +349,6 @@ describe('svg+text utils', function() {
349349
expect(i).toBe(355);
350350
});
351351

352-
it('decodes arbitrary decimal and hex number entities (IE case)', function() {
353-
// IE does not have String.fromCodePoint
354-
String.fromCodePoint = undefined;
355-
expect(String.fromCodePoint).toBeUndefined();
356-
357-
var i = 0;
358-
for(var n = 33; n < 0x10FFFF; n = Math.round(n * 1.03)) {
359-
var node = mockTextSVGElement(
360-
'&#x' + n.toString(16) +
361-
'; = &#' + n.toString() +
362-
'; = &#x' + n.toString(16).toUpperCase() + ';'
363-
);
364-
var char = stringFromCodePoint(n);
365-
expect(node.text()).toBe(char + ' = ' + char + ' = ' + char, n);
366-
i++;
367-
}
368-
// not really necessary to assert this, but we tested 355 characters,
369-
// weighted toward the low end but continuing all the way to the
370-
// end of the unicode definition
371-
expect(i).toBe(355);
372-
});
373-
374352
it('does not decode entities prematurely', function() {
375353
var testCases = [
376354
'&lt;b>not bold</b&gt;',

0 commit comments

Comments
 (0)