• 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
17
18import {LitPopContent} from "../../../dist/base-ui/popover/LitPopContent.js";
19
20describe("LitPopCont Test", () => {
21
22    it('LitPopCont01', () => {
23        let litPopContent = new LitPopContent();
24        expect(litPopContent).not.toBeUndefined()
25        expect(litPopContent).not.toBeNull()
26    });
27
28    it('LitPopCont02', () => {
29        let litPopContent = new LitPopContent();
30        expect(litPopContent.open).toBeFalsy()
31    });
32
33
34    it('LitPopCont03', () => {
35        let litPopContent = new LitPopContent();
36        litPopContent.open = false
37        expect(litPopContent.open).toBeFalsy()
38    });
39
40
41    it('LitPopCont04', () => {
42        let litPopContent = new LitPopContent();
43        litPopContent.open = true
44        expect(litPopContent.open).toBeTruthy()
45    });
46
47    it('LitPopCont04', () => {
48        let litPopContent = new LitPopContent();
49        litPopContent.name = "11"
50        expect(litPopContent.name).toEqual("11")
51    });
52
53    it('LitPopCont05', () => {
54        let litPopContent = new LitPopContent();
55        expect(litPopContent.initHtml()).toMatchInlineSnapshot(`
56"
57        <style>
58        :host{
59            font-family: Helvetica,serif;
60            position:absolute;
61            display:flex;
62            background:#ffffff;
63            box-shadow: -2px 0 3px -1px white, 0 -2px 3px -1px white, 0 2px 3px -1px white, 2px 0 3px -1px white;
64            box-sizing: border-box;
65            border-radius: 5px;
66            transition:0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
67            transform:scale(0);
68            transform-origin:inherit;
69            visibility:hidden;
70            z-index:10;
71
72        }
73        .pop-content-body{
74            display:flex;
75            flex:1;
76            padding: 20px;
77            flex-direction:column;
78            width: max-content;
79            box-sizing: border-box;
80            border: 1px solid #000000;
81        }
82        </style>
83        <div class=\\"pop-content-body\\" >
84            <slot></slot>
85        </div>
86        "
87`);
88    });
89
90    it('LitPopCont06', () => {
91        let litPopContent = new LitPopContent();
92        expect(litPopContent.attributeChangedCallback("open","",null || "false")).toBeUndefined()
93    });
94
95    it('LitPopCont07', () => {
96        let litPopContent = new LitPopContent();
97        expect(litPopContent.attributeChangedCallback("name","",'')).toBeUndefined();
98    });
99})
100