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 { LitSelectV } from '../../../src/base-ui/select/LitSelectV'; 17 18describe('LitSelectV Test', () => { 19 let litSelectV = new LitSelectV(); 20 it('LitSelectVTest01', function () { 21 expect(litSelectV.value).not.toBeUndefined(); 22 }); 23 it('LitSelectVTest02', function () { 24 litSelectV.rounded = true; 25 expect(litSelectV.rounded).toBeTruthy(); 26 }); 27 it('LitSelectVTest06', function () { 28 litSelectV.rounded = false; 29 expect(litSelectV.rounded).toBeFalsy(); 30 }); 31 it('LitSelectVTest03', function () { 32 expect(litSelectV.placement).toBe(''); 33 }); 34 it('LitSelectVTest04', function () { 35 litSelectV.placement = true; 36 expect(litSelectV.placement).toBeTruthy(); 37 }); 38 it('LitSelectVTest05', function () { 39 litSelectV.placement = false; 40 expect(litSelectV.placement).toBeFalsy(); 41 }); 42 it('LitSelectVTest07', function () { 43 litSelectV.boder = true; 44 expect(litSelectV.border).toBeTruthy(); 45 }); 46 it('LitSelectVTest08', function () { 47 litSelectV.border = false; 48 expect(litSelectV.border).toBe('false'); 49 }); 50 it('LitSelectVTest14', function () { 51 litSelectV.border = true; 52 expect(litSelectV.border).toBe('true'); 53 }); 54 it('LitSelectVTest09', function () { 55 litSelectV.defaultValue = 'test'; 56 expect(litSelectV.defaultValue).toBe('test'); 57 }); 58 it('LitSelectVTest010', function () { 59 litSelectV.placeholder = 'test'; 60 expect(litSelectV.placeholder).toBe('test'); 61 }); 62 it('LitSelectVTest011', function () { 63 litSelectV.all = true; 64 expect(litSelectV.all).toBeTruthy(); 65 }); 66 it('LitSelectVTest012', function () { 67 litSelectV.all = false; 68 expect(litSelectV.all).toBeFalsy(); 69 }); 70 it('LitSelectVTest013', function () { 71 let value = [ 72 { 73 length: 1, 74 }, 75 ]; 76 let valueStr = ''; 77 expect(litSelectV.dataSource(value, valueStr)).toBeUndefined(); 78 }); 79 it('LitSelectVTest014', function () { 80 let value = [ 81 { 82 length: 1, 83 }, 84 ]; 85 let valueStr = 'aa'; 86 expect(litSelectV.dataSource(value, valueStr)).toBeUndefined(); 87 }); 88 it('LitSelectVTest015', function () { 89 expect(litSelectV.connectedCallback()).toBeUndefined(); 90 }); 91 it('LitSelectVTest016', function () { 92 let valueStr = 'aa'; 93 expect(litSelectV.dataSource([], valueStr)).toBeUndefined(); 94 }); 95 it('LitSelectVTest017', function () { 96 let value = [ 97 { 98 length: 1, 99 }, 100 ]; 101 let valueStr = 'aa'; 102 litSelectV.all = true; 103 expect(litSelectV.dataSource(value, valueStr)).toBeUndefined(); 104 }); 105 it('LitSelectVTest018', function () { 106 let value = [ 107 { 108 length: 1, 109 }, 110 ]; 111 let valueStr = 'aa'; 112 litSelectV.title = 'Event List'; 113 expect(litSelectV.dataSource(value, valueStr)).toBeUndefined(); 114 }); 115}); 116