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 { LitSlider } from '../../../src/base-ui/slider/LitSlider'; 17 18describe('LitSlider Test', () => { 19 let litSliderPanel = new LitSlider(); 20 21 litSliderPanel.disabledX = 'disabledX'; 22 litSliderPanel.customSlider = 'customSlider'; 23 litSliderPanel.customLine = 'customLine'; 24 litSliderPanel.customButton = 'customButton'; 25 litSliderPanel.percent = 'percent'; 26 litSliderPanel.resultUnit = 'resultUnit'; 27 28 it('LitSliderTest01', () => { 29 expect(litSliderPanel.disabledX).toEqual(''); 30 }); 31 32 it('LitSliderTest02', () => { 33 expect(litSliderPanel.customSlider).toEqual(''); 34 }); 35 36 it('LitSliderTest03', () => { 37 expect(litSliderPanel.customLine).toEqual('customLine'); 38 }); 39 40 it('LitSliderTest04', () => { 41 expect(litSliderPanel.customButton).toEqual('customButton'); 42 }); 43 44 it('LitSliderTest05', () => { 45 expect(litSliderPanel.percent).toEqual('percent'); 46 }); 47 48 it('LitSliderTest06', () => { 49 expect(litSliderPanel.resultUnit).toEqual('resultUnit'); 50 }); 51 52 it('LitSliderTest07', () => { 53 expect(litSliderPanel.formatSeconds(10)).toBe('00:00:10'); 54 }); 55 56 it('LitSliderTest9', () => { 57 expect(litSliderPanel.adoptedCallback()).toBeUndefined(); 58 }); 59 60 it('LitSliderTest10', () => { 61 expect(litSliderPanel.disconnectedCallback()).toBeUndefined(); 62 }); 63 64 it('LitSliderTest11', () => { 65 expect(litSliderPanel.disconnectedCallback()).toBeUndefined(); 66 }); 67 68 it('LitSliderTest12', function () { 69 expect(litSliderPanel.attributeChangedCallback('percent', '', '0%' || null)).toBeUndefined(); 70 }); 71 72 it('LitSliderTest14', () => { 73 litSliderPanel.disabledX = false; 74 expect(litSliderPanel.disabledX).toBeFalsy(); 75 }); 76 77 it('LitSliderTest15', () => { 78 litSliderPanel.customSlider = false; 79 expect(litSliderPanel.customSlider).toBeFalsy(); 80 }); 81 82 it('LitSliderTest16', () => { 83 expect(litSliderPanel.formatSeconds(36000)).toBe('10:00:00'); 84 }); 85 86 it('LitSliderTest17', () => { 87 expect(litSliderPanel.formatSeconds(4000)).toBe('01:06:40'); 88 }); 89}); 90