• 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 {LitSlider} from "../../../dist/base-ui/slider/LitSlider.js";
18
19describe('LitSlider Test', ()=>{
20    let litSliderPanel = new LitSlider();
21
22    litSliderPanel.disabledX = 'disabledX'
23    litSliderPanel.customSlider = 'customSlider'
24    litSliderPanel.customLine = 'customLine'
25    litSliderPanel.customButton = 'customButton'
26    litSliderPanel.percent = 'percent'
27    litSliderPanel.resultUnit = 'resultUnit'
28
29    litSliderPanel.litSlider = jest.fn(()=> true)
30
31    litSliderPanel.sliderStyle = 'sliderStyle'
32
33    it('LitSliderTest01', ()=>{
34        expect(litSliderPanel.disabledX).toEqual('');
35    })
36
37    it('LitSliderTest02', ()=>{
38        expect(litSliderPanel.customSlider).toEqual('');
39    })
40
41    it('LitSliderTest03', ()=>{
42        expect(litSliderPanel.customLine).toEqual('customLine');
43    })
44
45    it('LitSliderTest04', ()=>{
46        expect(litSliderPanel.customButton).toEqual('customButton');
47    })
48
49    it('LitSliderTest05', ()=>{
50        expect(litSliderPanel.percent).toEqual('percent');
51    })
52
53    it('LitSliderTest06', ()=>{
54        expect(litSliderPanel.resultUnit).toEqual('resultUnit');
55    })
56
57    it('LitSliderTest07', ()=>{
58        expect(litSliderPanel.formatSeconds(10)).toBe('00:00:10');
59    })
60
61    it('LitSliderTest08', ()=>{
62        expect(litSliderPanel.renderDefaultSlider()).toBeUndefined();
63    })
64
65    it('LitSliderTest9', ()=>{
66        expect(litSliderPanel.adoptedCallback()).toBeUndefined();
67    })
68
69    it('LitSliderTest10', ()=>{
70        litSliderPanel.litSlider.removeEventListener = jest.fn(()=> true)
71        litSliderPanel.litSlider.removeEventListener = jest.fn(()=> true)
72        litSliderPanel.litSliderButton = jest.fn(()=> true)
73        litSliderPanel.litSliderButton.removeEventListener = jest.fn(()=> true)
74        expect(litSliderPanel.disconnectedCallback()).toBeUndefined();
75    })
76})
77