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 */ 15 16import { TabPaneHiLogSummary } from '../../../../../../src/trace/component/trace/sheet/hilog/TabPaneHiLogSummary'; 17 18window.ResizeObserver = 19 window.ResizeObserver || 20 jest.fn().mockImplementation(() => ({ 21 disconnect: jest.fn(), 22 observe: jest.fn(), 23 unobserve: jest.fn(), 24 })); 25 26describe('TabPaneHilogSummary Test', () => { 27 let summaryTab = new TabPaneHiLogSummary(); 28 29 let summaryData = { 30 leftNs: 0, 31 rightNs: 33892044011, 32 sysAlllogsData: [{ 33 id: 2, 34 pid: 1119, 35 tid: 1172, 36 processName: 'process1119', 37 startTs: 33872275426, 38 level: 'I', 39 tag: 'C02d0c/Hiprofiler', 40 context: 'ParseTimeExtend: upd', 41 time: 0, 42 depth: 0, 43 dur: 0, 44 },{ 45 id: 3, 46 pid: 1119, 47 tid: 1172, 48 processName: 'process1119', 49 startTs: 33874375717, 50 level: 'W', 51 tag: 'C02d0c/Hiprofiler', 52 context: 'ParseTimeExtend: upd', 53 time: 0, 54 depth: 0, 55 dur: 0, 56 },{ 57 id: 4, 58 pid: 1119, 59 tid: 1172, 60 processName: 'process1119', 61 startTs: 33878711051, 62 level: 'D', 63 tag: 'C02d0c/Hiprofiler', 64 context: 'ParseTimeExtend: upd', 65 time: 0, 66 depth: 0, 67 dur: 0, 68 },{ 69 id: 5, 70 pid: 1119, 71 tid: 1172, 72 processName: 'process1119', 73 startTs: 33885632885, 74 level: 'E', 75 tag: 'C02d0c/Hiprofiler', 76 context: 'ParseTimeExtend: upd', 77 time: 0, 78 depth: 0, 79 dur: 0, 80 },{ 81 id: 6, 82 pid: 1119, 83 tid: 1172, 84 processName: 'process1119', 85 startTs: 33889724969, 86 level: 'F', 87 tag: 'C02d0c/Hiprofiler', 88 context: 'ParseTimeExtend: upd', 89 time: 0, 90 depth: 0, 91 dur: 0, 92 },{ 93 id: 7, 94 pid: 1119, 95 tid: 1172, 96 processName: 'process1119', 97 startTs: 33892044011, 98 level: 'A', 99 tag: 'C02d0c/Hiprofiler', 100 context: 'ParseTimeExtend: upd', 101 time: 0, 102 depth: 0, 103 dur: 0, 104 }] 105 }; 106 107 it('TabPaneHilogSummaryTest01', function () { 108 summaryTab.data = summaryData; 109 expect(summaryTab.data).toBeUndefined(); 110 }); 111}); 112