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 16// @ts-ignore 17import {SpSystemTrace} from "../../../dist/trace/component/SpSystemTrace.js" 18 19window.ResizeObserver = window.ResizeObserver || 20 jest.fn().mockImplementation(() => ({ 21 disconnect: jest.fn(), 22 observe: jest.fn(), 23 unobserve: jest.fn(), 24 })); 25 26describe('SpSystemTrace Test', ()=>{ 27 let spSystemTrace = new SpSystemTrace(); 28 29 spSystemTrace.initElements = jest.fn(()=> true) 30 31 32 it('SpSystemTraceTest01', function () { 33 expect(spSystemTrace.getScrollWidth()).toBe(1) 34 }); 35 36 it('SpSystemTraceTest02', function () { 37 let resultLength = spSystemTrace.getVisibleRows([{}]).length; 38 expect(resultLength).toBe(0) 39 }); 40 41 it('SpSystemTraceTest03', function () { 42 expect(spSystemTrace.timerShaftELRangeChange('')).toBeUndefined() 43 }); 44 45 it('SpSystemTraceTest04', function () { 46 expect(spSystemTrace.rowsElOnScroll('Scroll')).toBeUndefined() 47 }); 48 49 it('SpSystemTraceTest05', function () { 50 expect(spSystemTrace.documentOnMouseDown('MouseDown')).toBeUndefined() 51 }); 52 53 it('SpSystemTraceTest06', function () { 54 expect(spSystemTrace.documentOnMouseUp('MouseUp')).toBeUndefined() 55 }); 56 57 it('SpSystemTraceTest07', function () { 58 expect(spSystemTrace.documentOnMouseMove('MouseMove')).toBeUndefined() 59 }); 60 61 it('SpSystemTraceTest08', function () { 62 expect(spSystemTrace.hoverStructNull('')).toBeUndefined() 63 }); 64 65 it('SpSystemTraceTest09', function () { 66 expect(spSystemTrace.selectStructNull('')).toBeUndefined() 67 }); 68 69 it('SpSystemTraceTest10', function () { 70 expect(spSystemTrace.documentOnClick('OnClick')).toBeUndefined() 71 }); 72 73 it('SpSystemTraceTest11', function () { 74 expect(spSystemTrace.connectedCallback()).toBeUndefined() 75 }); 76 77 it('SpSystemTraceTest12', function () { 78 expect(spSystemTrace.disconnectedCallback()).toBeUndefined() 79 }); 80}) 81