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