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