Skip to content

Commit 4e66dcf

Browse files
[fix]UT
1 parent 17cb64f commit 4e66dcf

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

test/common/overlay/KnowledgeGraphSpec.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ const data = {
6363

6464
describe('KnowledgeGraph', () => {
6565
var originalTimeout;
66-
var dom = window.document.createElement('div');
67-
dom.setAttribute('id', 'knowledgeGraph');
68-
dom.style.width = '450px';
69-
dom.style.height = '350px';
70-
window.document.body.appendChild(dom);
66+
var dom;
67+
beforeAll(() => {
68+
dom = window.document.createElement('div');
69+
dom.setAttribute('id', 'knowledgeGraph');
70+
dom.style.width = '450px';
71+
dom.style.height = '350px';
72+
window.document.body.appendChild(dom);
73+
});
74+
afterAll(() => {
75+
window.document.body.removeChild(dom);
76+
});
7177
beforeEach(() => {
7278
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
7379
jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;

0 commit comments

Comments
 (0)