• 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
17import { LitCheckBox } from '../../../dist/base-ui/checkbox/LitCheckBox.js';
18
19describe('checkBox Test', () => {
20  it('checkBoxTest01', function () {
21    let litCheckBox = new LitCheckBox();
22    expect(litCheckBox).not.toBeUndefined();
23    expect(litCheckBox).not.toBeNull();
24  });
25
26  it('checkBoxTest02', function () {
27    let litCheckBox = new LitCheckBox();
28    expect(litCheckBox.checked).toBeFalsy();
29  });
30
31  it('checkBoxTest03', function () {
32    let litCheckBox = new LitCheckBox();
33    litCheckBox.checked = true;
34    expect(litCheckBox.checked).toBeTruthy();
35  });
36
37  it('checkBoxTest04', function () {
38    let litCheckBox = new LitCheckBox();
39    expect(litCheckBox.value).toEqual('');
40  });
41
42  it('checkBoxTest04', function () {
43    let litCheckBox = new LitCheckBox();
44    litCheckBox.value = 'test';
45    expect(litCheckBox.value).toEqual('test');
46  });
47
48  it('checkBoxTest05', function () {
49    document.body.innerHTML = `<lit-check-box></lit-check-box>
50        `;
51    let litCheckBox = new LitCheckBox();
52    litCheckBox.checked = false;
53    expect(litCheckBox.checked).toBeFalsy();
54  });
55  it('checkBoxTest06', function () {
56    document.body.innerHTML = `<lit-check-box></lit-check-box>
57        `;
58    let litCheckBox = new LitCheckBox();
59    litCheckBox.indeterminate = false;
60    expect(litCheckBox.indeterminate).toBeFalsy();
61  });
62
63  it('checkBoxTest07', function () {
64    document.body.innerHTML = `<lit-check-box></lit-check-box>
65        `;
66    let litCheckBox = new LitCheckBox();
67    litCheckBox.indeterminate = true;
68    expect(litCheckBox.indeterminate).toBeTruthy();
69  });
70});
71