Skip to content

Commit 17cb64f

Browse files
2 parents 1ceeca2 + 47ac11a commit 17cb64f

File tree

4 files changed

+44
-16
lines changed

4 files changed

+44
-16
lines changed

test/leaflet/overlay/GraphMapSpec.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@ var knowledgegraphmapURL = knowledgegraphURL + '/graphmaps/xxx图谱';
77

88
describe('GraphMap leaflet', () => {
99
var originalTimeout;
10-
var dom = window.document.createElement('div');
11-
dom.setAttribute('id', 'knowledgeGraph');
12-
dom.style.width = '450px';
13-
dom.style.height = '350px';
10+
var dom;
1411
beforeEach(() => {
1512
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
1613
jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;
1714
});
1815
afterEach(() => {
1916
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
2017
});
18+
beforeAll(() => {
19+
dom = window.document.createElement('div');
20+
dom.setAttribute('id', 'knowledgeGraph');
21+
dom.style.width = '450px';
22+
dom.style.height = '350px';
23+
window.document.body.appendChild(dom);
24+
});
25+
afterAll(() => {
26+
window.document.body.removeChild(dom);
27+
});
2128

2229
it('createGraphMap', (done) => {
2330
spyOn(FetchRequest, 'get').and.callFake((testUrl) => {

test/mapboxgl/overlay/GraphMapSpec.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ var knowledgegraphmapURL = knowledgegraphURL + '/graphmaps/xxx图谱';
77

88
describe('GraphMap mapboxgl', () => {
99
var originalTimeout;
10-
var dom = window.document.createElement('div');
11-
dom.setAttribute('id', 'knowledgeGraph');
12-
dom.style.width = '450px';
13-
dom.style.height = '350px';
10+
var dom;
11+
beforeAll(() => {
12+
dom = window.document.createElement('div');
13+
dom.setAttribute('id', 'knowledgeGraph');
14+
dom.style.width = '450px';
15+
dom.style.height = '350px';
16+
window.document.body.appendChild(dom);
17+
});
18+
afterAll(() => {
19+
window.document.body.removeChild(dom);
20+
});
1421
beforeEach(() => {
1522
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
1623
jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;

test/maplibregl/overlay/GraphMapSpec.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ var knowledgegraphmapURL = knowledgegraphURL + '/graphmaps/xxx图谱';
77

88
describe('GraphMap leaflet', () => {
99
var originalTimeout;
10-
var dom = window.document.createElement('div');
11-
dom.setAttribute('id', 'knowledgeGraph');
12-
dom.style.width = '450px';
13-
dom.style.height = '350px';
10+
var dom;
11+
beforeAll(() => {
12+
dom = window.document.createElement('div');
13+
dom.setAttribute('id', 'knowledgeGraph');
14+
dom.style.width = '450px';
15+
dom.style.height = '350px';
16+
window.document.body.appendChild(dom);
17+
});
18+
afterAll(() => {
19+
window.document.body.removeChild(dom);
20+
});
1421
beforeEach(() => {
1522
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
1623
jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;

test/openlayers/overlay/GraphMapSpec.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ var knowledgegraphmapURL = knowledgegraphURL + '/graphmaps/xxx图谱';
77

88
describe('GraphMap openlayers', () => {
99
var originalTimeout;
10-
var dom = window.document.createElement('div');
11-
dom.setAttribute('id', 'knowledgeGraph');
12-
dom.style.width = '450px';
13-
dom.style.height = '350px';
10+
var dom;
11+
beforeAll(() => {
12+
dom = window.document.createElement('div');
13+
dom.setAttribute('id', 'knowledgeGraph');
14+
dom.style.width = '450px';
15+
dom.style.height = '350px';
16+
window.document.body.appendChild(dom);
17+
});
18+
afterAll(() => {
19+
window.document.body.removeChild(dom);
20+
});
1421
beforeEach(() => {
1522
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
1623
jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;

0 commit comments

Comments
 (0)