• 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
16import { LitPopover } from '../../../src/base-ui/popover/LitPopoverV';
17
18describe('LitPopoverV Test', () => {
19  it('LitPopoverV01', () => {
20    let litPopover = new LitPopover();
21    expect(litPopover).not.toBeUndefined();
22    expect(litPopover).not.toBeNull();
23  });
24  it('LitPopoverV02', () => {
25    let litPopoverV = new LitPopover();
26    expect(litPopoverV.visible).toBe('false');
27  });
28  it('LitPopoverV03', () => {
29    let litPopoverV = new LitPopover();
30    litPopoverV.visible = true;
31    expect(litPopoverV.visible).toBe('true');
32  });
33  it('LitPopoverV04', () => {
34    let litPopoverV = new LitPopover();
35    litPopoverV.visible = false;
36    expect(litPopoverV.visible).toBe('false');
37  });
38  it('LitPopoverV05', () => {
39    let litPopoverV = new LitPopover();
40    expect(litPopoverV.trigger).toBe('hover');
41  });
42  it('LitPopoverV06', () => {
43    let litPopoverV = new LitPopover();
44    litPopoverV.trigger = 'click';
45    expect(litPopoverV.trigger).toBe('click');
46  });
47
48  it('LitPopoverV07', () => {
49    let litPopoverV = new LitPopover();
50    litPopoverV.title = 'test';
51    expect(litPopoverV.title).toBe('test');
52  });
53
54  it('LitPopoverV08', () => {
55    let litPopoverV = new LitPopover();
56    litPopoverV.width = '10px';
57    expect(litPopoverV.width).toBe('10px');
58  });
59
60  it('LitPopoverV09', () => {
61    let litPopoverV = new LitPopover();
62    litPopoverV.width = '10px';
63    expect(litPopoverV.width).toBe('10px');
64  });
65
66  it('LitPopoverV10', () => {
67    let litPopoverV = new LitPopover();
68    expect(litPopoverV.width).toBe('max-content');
69  });
70
71  it('LitPopoverV11', () => {
72    let litPopoverV = new LitPopover();
73    expect(litPopoverV.haveRadio).toBeNull();
74  });
75
76  it('LitPopoverV12', () => {
77    document.body.innerHTML = `<lit-popover id="litpop"></lit-popover>`;
78    let popver = document.querySelector('#litpop') as LitPopover;
79    expect(popver.haveRadio).toBeNull();
80  });
81
82  it('LitPopoverV14', () => {
83    document.body.innerHTML = `<lit-popover id="litpop"></lit-popover>`;
84    let popver = document.querySelector('#litpop') as LitPopover;
85    expect(popver.adoptedCallback()).toBeUndefined();
86  });
87});
88