1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import { HeapNode,HeapEdge,HeapTraceFunctionInfo,HeapSample,HeapLocation,HeapSnapshotStruct,FileStruct } from '../../../src/js-heap/model/DatabaseStruct'; 16// @ts-ignore 17window.ResizeObserver = window.ResizeObserver || jest.fn().mockImplementation(() => ({ 18 disconnect: jest.fn(), 19 observe: jest.fn(), 20 unobserve: jest.fn(), 21})); 22 23describe('DatabaseStruct Test', () => { 24 it('DatabaseStructTest01', () => { 25 let heapNode = new HeapNode(); 26 expect(heapNode).not.toBeUndefined(); 27 }); 28 it('DatabaseStructTest02', () => { 29 let heapEdge = new HeapEdge(); 30 expect(heapEdge).not.toBeUndefined(); 31 }); 32 it('DatabaseStructTest03', () => { 33 let heapTraceFunctionInfo = new HeapTraceFunctionInfo(); 34 expect(heapTraceFunctionInfo).not.toBeUndefined(); 35 }); 36 it('DatabaseStructTest04', () => { 37 let heapLocation = new HeapLocation(); 38 expect(heapLocation).not.toBeUndefined(); 39 }); 40 it('DatabaseStructTest05', () => { 41 let heapSnapshotStruct = new HeapSnapshotStruct(); 42 expect(heapSnapshotStruct).not.toBeUndefined(); 43 }); 44 it('DatabaseStructTest06', () => { 45 let fileStruct = new FileStruct(); 46 expect(fileStruct).not.toBeUndefined(); 47 }); 48 it('DatabaseStructTest07', () => { 49 let heapNode = new HeapNode(); 50 expect(heapNode.className()).toBe('(undefined)'); 51 }); 52 it('DatabaseStructTest09', () => { 53 let heapNode = new HeapNode(); 54 expect(heapNode.nodeName()).toBeUndefined(); 55 }); 56 it('DatabaseStructTest10', () => { 57 let heapNode = new HeapNode(); 58 expect(heapNode.addEdge({})).toBeUndefined; 59 }); 60 it('DatabaseStructTest11', () => { 61 let heapNode = new HeapNode(); 62 expect(heapNode.idHidden()).toBeUndefined; 63 }); 64 it('DatabaseStructTest12', () => { 65 let heapNode = new HeapNode(); 66 expect(heapNode.isArray()).toBeUndefined; 67 }); 68 it('DatabaseStructTest13', () => { 69 let heapNode = new HeapNode(); 70 expect(heapNode.isUserRoot()).toBeUndefined; 71 }); 72 it('DatabaseStructTest14', () => { 73 let heapNode = new HeapNode(); 74 expect(heapNode.isDocumentDOMTreesRoot()).toBeUndefined; 75 }); 76 it('DatabaseStructTest15', () => { 77 let heapNode = new HeapSample(); 78 expect(HeapSample).not.toBeUndefined; 79 }); 80}) 81