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 { SpAllocations } from '../../../../src/trace/component/setting/SpAllocations';
17
18describe('SpAllocations Test', () => {
19  beforeAll(() => {
20    document.body.innerHTML = `
21            <sp-allocations id = "sp"><sp-allocations>
22        `;
23  });
24
25  it(' SpAllocations get Default attrValue', function () {
26    let spEle = document.querySelector('#sp') as SpAllocations;
27    spEle.unwindEL = jest.fn(() => true);
28    spEle.unwindEL.value = jest.fn(() => true);
29    spEle.shareMemory = jest.fn(() => true);
30    spEle.shareMemory.value = jest.fn(() => true);
31    spEle.shareMemoryUnit = jest.fn(() => true);
32    spEle.shareMemoryUnit.value = jest.fn(() => true);
33    spEle.filterMemory = jest.fn(() => true);
34    spEle.filterMemory.value = jest.fn(() => true);
35    spEle.filterMemoryUnit = jest.fn(() => true);
36    spEle.filterMemoryUnit.value = jest.fn(() => true);
37    expect(spEle.pid).toEqual(undefined);
38    expect(spEle.unwind).toBeUndefined();
39    expect(spEle.shared).toBeUndefined();
40    expect(spEle.filter).toBeUndefined();
41  });
42  it('SpAllocations test01', function () {
43    let spAllocations = document.querySelector('#sp') as SpAllocations;
44    expect(spAllocations.appProcess).toBeUndefined();
45  });
46
47  it('SpAllocations test02', function () {
48    let spAllocations = document.querySelector('#sp') as SpAllocations;
49    expect(spAllocations.fp_unwind).toBeUndefined();
50  });
51  it('SpAllocations test03', function () {
52    let spAllocations = document.querySelector('#sp') as SpAllocations;
53    expect(spAllocations.record_accurately).toBeUndefined();
54  });
55  it('SpAllocations test04', function () {
56    let spAllocations = document.querySelector('#sp') as SpAllocations;
57    expect(spAllocations.offline_symbolization).toBeUndefined();
58  });
59  it('SpAllocations test05', function () {
60    let spAllocations = document.querySelector('#sp') as SpAllocations;
61    expect(spAllocations.record_statistics).toBeUndefined();
62  });
63  it('SpAllocations test06', function () {
64    let spAllocations = document.querySelector('#sp') as SpAllocations;
65    expect(spAllocations.statistics_interval).toBeUndefined();
66  });
67  it('SpAllocations test07', function () {
68    let spAllocations = document.querySelector('#sp') as SpAllocations;
69    expect(spAllocations.startup_mode).toBeFalsy();
70  });
71});
72