• 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//@ts-ignore
16import {TabPaneDiskAbility} from "../../../../../../dist/trace/component/trace/sheet/ability/TabPaneDiskAbility.js";
17window.ResizeObserver = window.ResizeObserver || jest.fn().mockImplementation(()=>({
18    disconnect: jest.fn(),
19    observe: jest.fn(),
20    unobserve: jest.fn(),
21}))
22
23describe('TabPaneDiskAbility Test', ()=>{
24
25    let tabPaneDiskAbility = new TabPaneDiskAbility();
26    it('TabPaneDiskAbilityTest01',()=>{
27        tabPaneDiskAbility.queryResult.length = 1;
28        expect(tabPaneDiskAbility.filterData()).toBeUndefined();
29    });
30
31    it('TabPaneDiskAbilityTest02 ', function () {
32        const val = {
33            startTimeStr:"",
34            durationStr:"",
35            dataReadStr:"",
36            dataReadSecStr:"",
37            dataWriteStr:"",
38            readsInStr:"",
39            readsInSecStr:"",
40            writeOutStr:"",
41            writeOutSecStr:""
42        }
43        expect(tabPaneDiskAbility.toDiskAbilityArray(val)).not.toBeUndefined();
44    });
45
46    it('TabPaneDiskAbilityTest03 ', function () {
47        expect(tabPaneDiskAbility.sortByColumn({
48            key:'startTime',
49        })).toBeUndefined();
50    });
51
52    it('TabPaneDiskAbilityTest04 ', function () {
53        expect(tabPaneDiskAbility.sortByColumn({
54            key:!'startTime',
55        })).toBeUndefined();
56    });
57
58    it('TabPaneDiskAbilityTest05 ', function () {
59        expect(tabPaneDiskAbility.sortByColumn({
60            key:'durationStr',
61        })).toBeUndefined();
62    });
63
64    it('TabPaneDiskAbilityTest06 ', function () {
65        expect(tabPaneDiskAbility.sortByColumn({
66            key:'dataReadStr',
67        })).toBeUndefined();
68    });
69
70    it('TabPaneDiskAbilityTest07 ', function () {
71        expect(tabPaneDiskAbility.sortByColumn({
72            key:'dataReadSecStr',
73        })).toBeUndefined();
74    });
75
76    it('TabPaneDiskAbilityTest08 ', function () {
77        expect(tabPaneDiskAbility.sortByColumn({
78            key:'dataWriteStr',
79        })).toBeUndefined();
80    });
81
82    it('TabPaneDiskAbilityTest09 ', function () {
83        expect(tabPaneDiskAbility.sortByColumn({
84            key:'dataWriteSecStr',
85        })).toBeUndefined();
86    });
87
88    it('TabPaneDiskAbilityTest10 ', function () {
89        expect(tabPaneDiskAbility.sortByColumn({
90            key:'readsInStr',
91        })).toBeUndefined();
92    });
93
94    it('TabPaneDiskAbilityTest11 ', function () {
95        expect(tabPaneDiskAbility.sortByColumn({
96            key:'readsInSecStr',
97        })).toBeUndefined();
98    });
99
100    it('TabPaneDiskAbilityTest12', function () {
101        expect(tabPaneDiskAbility.sortByColumn({
102            key:'writeOutStr',
103        })).toBeUndefined();
104    });
105
106    it('TabPaneDiskAbilityTest13', function () {
107        expect(tabPaneDiskAbility.sortByColumn({
108            key:'writeOutSecStr',
109        })).toBeUndefined();
110    });
111})