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 21 it('checkBoxTest01', function () { 22 let litCheckBox = new LitCheckBox(); 23 expect(litCheckBox).not.toBeUndefined() 24 expect(litCheckBox).not.toBeNull() 25 }); 26 27 28 it('checkBoxTest02', function () { 29 let litCheckBox = new LitCheckBox(); 30 expect(litCheckBox.checked).toBeFalsy(); 31 }); 32 33 it('checkBoxTest03', function () { 34 let litCheckBox = new LitCheckBox(); 35 litCheckBox.checked = true 36 expect(litCheckBox.checked).toBeTruthy(); 37 }); 38 39 40 it('checkBoxTest04', function () { 41 let litCheckBox = new LitCheckBox(); 42 expect(litCheckBox.value).toEqual(""); 43 }); 44 45 46 it('checkBoxTest04', function () { 47 let litCheckBox = new LitCheckBox(); 48 litCheckBox.value = "test" 49 expect(litCheckBox.value).toEqual("test"); 50 }); 51 52 53 it('checkBoxTest05', function () { 54 document.body.innerHTML = `<lit-check-box></lit-check-box> 55 ` 56 let litCheckBox = new LitCheckBox(); 57 litCheckBox.checked = false 58 expect(litCheckBox.checked).toBeFalsy(); 59 }); 60})