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 { LitTreeNode } from '../../../src/base-ui/tree/LitTreeNode'; 17jest.mock('../../../src/trace/component/trace/base/TraceRow', () => { 18 return {}; 19}); 20 21describe('LitTreeNode Test', () => { 22 let litTreeNode = new LitTreeNode(); 23 litTreeNode.data = []; 24 litTreeNode.checkable = 'true'; 25 litTreeNode.multiple = true; 26 litTreeNode.iconName = ''; 27 litTreeNode.topDepth = true; 28 litTreeNode.arrow = true; 29 litTreeNode.open = 'true'; 30 litTreeNode.selected = true; 31 litTreeNode.checked = false; 32 33 it('LitTreeNodeTest01', () => { 34 expect(litTreeNode.data).toStrictEqual([]); 35 }); 36 it('LitTreeNodeTest02', () => { 37 expect(litTreeNode.checkable).toStrictEqual("true"); 38 }); 39 it('LitTreeNodeTest03', () => { 40 expect(litTreeNode.multiple).toStrictEqual(true); 41 }); 42 it('LitTreeNodeTest04', () => { 43 expect(litTreeNode.iconName).toStrictEqual(''); 44 }); 45 it('LitTreeNodeTest05', () => { 46 expect(litTreeNode.topDepth).toStrictEqual(true); 47 }); 48 it('LitTreeNodeTest06', () => { 49 expect(litTreeNode.arrow).toStrictEqual(true); 50 }); 51 it('LitTreeNodeTest07', () => { 52 expect(litTreeNode.open).toStrictEqual('true'); 53 }); 54 it('LitTreeNodeTest07', () => { 55 expect(litTreeNode.selected).toStrictEqual(true); 56 }); 57 it('LitTreeNodeTest08', () => { 58 expect(litTreeNode.checked).toStrictEqual(false); 59 }); 60 it('LitTreeNodeTest09', () => { 61 expect(litTreeNode.expand()).toBeUndefined(); 62 }); 63 it('LitTreeNodeTest10', () => { 64 document.body.innerHTML = `<ul id="ul"></ul>`; 65 let element = document.querySelector('#ul') as HTMLDivElement; 66 expect(litTreeNode.collapseSection(element)).toBeUndefined(); 67 }); 68 it('LitTreeNodeTest11', () => { 69 document.body.innerHTML = `<ul id="ul"></ul>`; 70 let element = document.querySelector('#ul') as HTMLDivElement; 71 expect(litTreeNode.expandSection(element)).toBeUndefined(); 72 }); 73 it('LitTreeNodeTest12', () => { 74 expect(litTreeNode.attributeChangedCallback('title',[],'av')).toBeUndefined(); 75 }); 76 it('LitTreeNodeTest13', () => { 77 expect(litTreeNode.drawLine('top')).toBeUndefined(); 78 }); 79 it('LitTreeNodeTest14', () => { 80 expect(litTreeNode.drawLine('bottom')).toBeUndefined(); 81 }); 82 it('LitTreeNodeTest15', () => { 83 expect(litTreeNode.drawLine('top-right')).toBeUndefined(); 84 }); 85 it('LitTreeNodeTest16', () => { 86 expect(litTreeNode.drawLine('bottom-right')).toBeUndefined(); 87 }); 88 it('LitTreeNodeTest17', () => { 89 expect(litTreeNode.collapse()).toBeUndefined(); 90 }); 91}); 92