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 { SpRecordPerf } from '../../../../src/trace/component/setting/SpRecordPerf';
17
18describe('SpRecordPerf Test', () => {
19  let spRecordPerf;
20  beforeEach(() => {
21    spRecordPerf = new SpRecordPerf();
22  });
23
24  it('SpRecordPerfTest01', function () {
25    expect(spRecordPerf).not.toBeUndefined();
26  });
27
28  it('SpRecordPerfTest02', function () {
29    expect(spRecordPerf.show).toBeFalsy();
30  });
31
32  it('SpRecordPerfTest03', function () {
33    spRecordPerf.show = true;
34    expect(spRecordPerf.show).toBeTruthy();
35  });
36
37  it('SpRecordPerfTest08', function () {
38    spRecordPerf.show = false;
39    expect(spRecordPerf.show).toBeFalsy();
40  });
41
42  it('SpRecordPerfTest09', function () {
43    expect(spRecordPerf.startSamp).toBeFalsy();
44  });
45
46  it('SpRecordPerfTest10', function () {
47    spRecordPerf.startSamp = true;
48    expect(spRecordPerf.startSamp).toBeTruthy();
49  });
50
51  it('SpRecordPerfTest11', function () {
52    spRecordPerf.startSamp = false;
53    expect(spRecordPerf.startSamp).toBeFalsy();
54  });
55
56  it('SpRecordPerfTest05', function () {
57    expect(spRecordPerf.unDisable()).toBeUndefined();
58  });
59
60  it('SpRecordPerfTest06', function () {
61    expect(spRecordPerf.startSamp).toBeFalsy();
62  });
63
64  it('SpRecordPerfTest07', function () {
65    spRecordPerf.startSamp = true;
66    expect(spRecordPerf.startSamp).toBeTruthy();
67  });
68
69  it('SpRecordPerfTest011', function () {
70    expect(spRecordPerf.getPerfConfig()).toBeTruthy();
71  });
72
73  it('SpRecordPerfTest012', function () {
74    expect(spRecordPerf.parseEvent).not.toBeUndefined();
75  });
76});
77