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//@ts-ignore 16import { LitDrawer } from '../../../dist/base-ui/drawer/LitDrawer.js'; 17// @ts-ignore 18window.ResizeObserver = window.ResizeObserver || jest.fn().mockImplementation(() => ({ 19 disconnect: jest.fn(), 20 observe: jest.fn(), 21 unobserve: jest.fn(), 22})); 23 24describe('LitDrawer Test', () => { 25 it('LitDrawerTest01', () => { 26 let litDrawer = new LitDrawer(); 27 expect(litDrawer).not.toBeUndefined(); 28 }); 29 it('LitDrawerTest02', () => { 30 let litDrawer = new LitDrawer(); 31 expect(litDrawer.contentWidth).toBe('400px'); 32 }); 33 it('LitDrawerTest03', () => { 34 let litDrawer = new LitDrawer(); 35 expect(litDrawer.contentPadding).toBe('20px'); 36 }); 37 it('LitDrawerTest04', () => { 38 let litDrawer = new LitDrawer(); 39 expect(litDrawer.placement).toBe(null); 40 }); 41 it('LitDrawerTest05', () => { 42 let litDrawer = new LitDrawer(); 43 expect(litDrawer.title).toBe(''); 44 }); 45 it('LitDrawerTest06', () => { 46 let litDrawer = new LitDrawer(); 47 expect(litDrawer.visible).toBe(false); 48 }); 49 it('LitDrawerTest07', () => { 50 let litDrawer = new LitDrawer(); 51 litDrawer.contentWidth = 'content-width' 52 expect(litDrawer.contentWidth).toBe('content-width'); 53 }); 54 it('LitDrawerTest08', () => { 55 let litDrawer = new LitDrawer(); 56 litDrawer.contentPadding = 'content-padding'; 57 expect(litDrawer.contentPadding).toBe('content-padding'); 58 }); 59 it('LitDrawerTest09', () => { 60 let litDrawer = new LitDrawer(); 61 litDrawer.placement = 'placement' 62 expect(litDrawer.placement).toBe('placement'); 63 }); 64 it('LitDrawerTest10', () => { 65 let litDrawer = new LitDrawer(); 66 litDrawer.title = 'title' 67 expect(litDrawer.title).toBe('title'); 68 }); 69 it('LitDrawerTest11', () => { 70 let litDrawer = new LitDrawer(); 71 litDrawer.visible = true; 72 expect(litDrawer.visible).toBe(true); 73 }); 74 it('LitDrawerTest12', () => { 75 let litDrawer = new LitDrawer(); 76 expect(litDrawer.mask).toBe(false); 77 }); 78 it('LitDrawerTest13', () => { 79 let litDrawer = new LitDrawer(); 80 litDrawer.mask = true; 81 expect(litDrawer.mask).toBe(true); 82 }); 83 it('LitDrawerTest14', () => { 84 let litDrawer = new LitDrawer(); 85 expect(litDrawer.maskCloseable).toBe(false); 86 }); 87 it('LitDrawerTest15', () => { 88 let litDrawer = new LitDrawer(); 89 litDrawer.maskCloseable = true; 90 expect(litDrawer.maskCloseable).toBe(true); 91 }); 92 it('LitDrawerTest16', () => { 93 let litDrawer = new LitDrawer(); 94 expect(litDrawer.closeable).toBe(false); 95 }); 96 it('LitDrawerTest17', () => { 97 let litDrawer = new LitDrawer(); 98 litDrawer.closeable = true; 99 expect(litDrawer.closeable).toBe(true); 100 }); 101 it('LitDrawerTest18', () => { 102 let litDrawer = new LitDrawer(); 103 expect(litDrawer.adoptedCallback()).toBeUndefined(); 104 }); 105})