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 { LitMainMenu } from '../../../src/base-ui/menu/LitMainMenu'; 17import { MenuItem } from '../../../src/base-ui/menu/LitMainMenu'; 18 19describe('LitMainMenu Test', () => { 20 it('LitMainMenu01', () => { 21 let litMainMenu = new LitMainMenu(); 22 expect(litMainMenu).not.toBeUndefined(); 23 expect(litMainMenu).not.toBeNull(); 24 }); 25 26 it('LitMainMenu01', () => { 27 let litMainMenu = new LitMainMenu(); 28 expect(litMainMenu).not.toBeUndefined(); 29 expect(litMainMenu).not.toBeNull(); 30 }); 31 32 it('LitMainMenu02', () => { 33 let litMainMenu = new LitMainMenu(); 34 litMainMenu.menus = [ 35 { 36 collapsed: false, 37 title: 'Navigation', 38 describe: 'Open or record a new trace', 39 children: [ 40 { 41 title: 'Open trace file', 42 icon: 'folder', 43 fileChoose: true, 44 fileHandler: function (ev: InputEvent) {}, 45 }, 46 { 47 title: 'Record new trace', 48 icon: 'copyhovered', 49 clickHandler: function (item: MenuItem) {}, 50 }, 51 ], 52 }, 53 ]; 54 expect(litMainMenu.menus.length).toBe(1); 55 }); 56 57 it('LitMainMenu04', () => { 58 let litMainMenu = new LitMainMenu(); 59 litMainMenu.menus = [ 60 { 61 children: [ 62 { 63 title: 'Record new trace Test', 64 icon: 'copyhovered', 65 clickHandler: function (item: MenuItem) {}, 66 }, 67 { 68 title: 'Open trace file Test', 69 icon: 'folder', 70 fileChoose: true, 71 fileHandler: function (ev: InputEvent) {}, 72 }, 73 ], 74 collapsed: true, 75 title: 'Navigation Test', 76 describe: 'Open or record a new trace', 77 }, 78 ]; 79 expect(litMainMenu.menus.length).toBe(1); 80 }); 81}); 82