1fb726d48Sopenharmony_ci/* 2fb726d48Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd. 3fb726d48Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4fb726d48Sopenharmony_ci * you may not use this file except in compliance with the License. 5fb726d48Sopenharmony_ci * You may obtain a copy of the License at 6fb726d48Sopenharmony_ci * 7fb726d48Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8fb726d48Sopenharmony_ci * 9fb726d48Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10fb726d48Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11fb726d48Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12fb726d48Sopenharmony_ci * See the License for the specific language governing permissions and 13fb726d48Sopenharmony_ci * limitations under the License. 14fb726d48Sopenharmony_ci */ 15fb726d48Sopenharmony_ci 16fb726d48Sopenharmony_ciimport { LitPageTable } from '../../../src/base-ui/table/LitPageTable'; 17fb726d48Sopenharmony_ciimport { LitTableColumn } from '../../../src/base-ui/table/lit-table-column'; 18fb726d48Sopenharmony_ciimport { TableRowObject } from '../../../src/base-ui/table/TableRowObject'; 19fb726d48Sopenharmony_ciimport { LitProgressBar } from '../../../src/base-ui/progress-bar/LitProgressBar'; 20fb726d48Sopenharmony_ciimport { LitIcon } from '../../../src/base-ui/icon/LitIcon'; 21fb726d48Sopenharmony_cidescribe('LitTable Test', () => { 22fb726d48Sopenharmony_ci window.ResizeObserver = 23fb726d48Sopenharmony_ci window.ResizeObserver || 24fb726d48Sopenharmony_ci jest.fn().mockImplementation(() => ({ 25fb726d48Sopenharmony_ci disconnect: jest.fn(), 26fb726d48Sopenharmony_ci observe: jest.fn(), 27fb726d48Sopenharmony_ci unobserve: jest.fn(), 28fb726d48Sopenharmony_ci })); 29fb726d48Sopenharmony_ci let litTable = new LitPageTable(); 30fb726d48Sopenharmony_ci litTable.selectable = true; 31fb726d48Sopenharmony_ci litTable.selectable = false; 32fb726d48Sopenharmony_ci litTable.scrollY = 'scrollY'; 33fb726d48Sopenharmony_ci 34fb726d48Sopenharmony_ci litTable.recycleDataSource = []; 35fb726d48Sopenharmony_ci 36fb726d48Sopenharmony_ci litTable.recycleDataSource = [ 37fb726d48Sopenharmony_ci { 38fb726d48Sopenharmony_ci id: 1, 39fb726d48Sopenharmony_ci name: 'name', 40fb726d48Sopenharmony_ci }, 41fb726d48Sopenharmony_ci { 42fb726d48Sopenharmony_ci id: 2, 43fb726d48Sopenharmony_ci name: 'nameValue', 44fb726d48Sopenharmony_ci }, 45fb726d48Sopenharmony_ci ]; 46fb726d48Sopenharmony_ci const td = { 47fb726d48Sopenharmony_ci style: { 48fb726d48Sopenharmony_ci position: 'sticky', 49fb726d48Sopenharmony_ci left: '0px', 50fb726d48Sopenharmony_ci right: '0px', 51fb726d48Sopenharmony_ci boxShadow: '3px 0px 5px #33333333', 52fb726d48Sopenharmony_ci }, 53fb726d48Sopenharmony_ci }; 54fb726d48Sopenharmony_ci const placement = 'left'; 55fb726d48Sopenharmony_ci 56fb726d48Sopenharmony_ci const element = { 57fb726d48Sopenharmony_ci style: { 58fb726d48Sopenharmony_ci display: 'none', 59fb726d48Sopenharmony_ci transform: 'translateY', 60fb726d48Sopenharmony_ci }, 61fb726d48Sopenharmony_ci childNodes: { forEach: true }, 62fb726d48Sopenharmony_ci onclick: 1, 63fb726d48Sopenharmony_ci }; 64fb726d48Sopenharmony_ci const rowObject = { 65fb726d48Sopenharmony_ci children: { 66fb726d48Sopenharmony_ci length: 1, 67fb726d48Sopenharmony_ci }, 68fb726d48Sopenharmony_ci data: [{ isSelected: undefined }], 69fb726d48Sopenharmony_ci depth: 1, 70fb726d48Sopenharmony_ci top: 1, 71fb726d48Sopenharmony_ci }; 72fb726d48Sopenharmony_ci const firstElement = 73fb726d48Sopenharmony_ci { 74fb726d48Sopenharmony_ci style: { 75fb726d48Sopenharmony_ci display: 'none', 76fb726d48Sopenharmony_ci paddingLeft: '', 77fb726d48Sopenharmony_ci transform: 'translateY', 78fb726d48Sopenharmony_ci }, 79fb726d48Sopenharmony_ci innerHTML: '', 80fb726d48Sopenharmony_ci title: '', 81fb726d48Sopenharmony_ci firstChild: null, 82fb726d48Sopenharmony_ci onclick: 1, 83fb726d48Sopenharmony_ci } || undefined; 84fb726d48Sopenharmony_ci 85fb726d48Sopenharmony_ci litTable.columns = litTable.columns || jest.fn(() => true); 86fb726d48Sopenharmony_ci 87fb726d48Sopenharmony_ci litTable.tbodyElement = jest.fn(() => ({ 88fb726d48Sopenharmony_ci innerHTML: '', 89fb726d48Sopenharmony_ci })); 90fb726d48Sopenharmony_ci 91fb726d48Sopenharmony_ci litTable.tableColumns = jest.fn(() => []); 92fb726d48Sopenharmony_ci 93fb726d48Sopenharmony_ci litTable.tableColumns.forEach = jest.fn(() => []); 94fb726d48Sopenharmony_ci 95fb726d48Sopenharmony_ci it('LitTablePageTest01', () => { 96fb726d48Sopenharmony_ci expect(litTable.adoptedCallback()).toBeUndefined(); 97fb726d48Sopenharmony_ci }); 98fb726d48Sopenharmony_ci 99fb726d48Sopenharmony_ci it('LitTablePageTest02', () => { 100fb726d48Sopenharmony_ci expect(litTable.disconnectedCallback()).toBeUndefined(); 101fb726d48Sopenharmony_ci }); 102fb726d48Sopenharmony_ci 103fb726d48Sopenharmony_ci it('LitTablePageTest03', () => { 104fb726d48Sopenharmony_ci expect(litTable.attributeChangedCallback('name', 'a', 'b')).toBeUndefined(); 105fb726d48Sopenharmony_ci }); 106fb726d48Sopenharmony_ci 107fb726d48Sopenharmony_ci it('LitTablePageTest04', () => { 108fb726d48Sopenharmony_ci litTable.hideDownload = true; 109fb726d48Sopenharmony_ci expect(litTable.hideDownload).toBeTruthy(); 110fb726d48Sopenharmony_ci }); 111fb726d48Sopenharmony_ci 112fb726d48Sopenharmony_ci it('LitTablePageTest05', () => { 113fb726d48Sopenharmony_ci expect(litTable.hideDownload).not.toBeUndefined(); 114fb726d48Sopenharmony_ci }); 115fb726d48Sopenharmony_ci 116fb726d48Sopenharmony_ci it('LitTablePageTest06', () => { 117fb726d48Sopenharmony_ci litTable.hideDownload = false; 118fb726d48Sopenharmony_ci expect(litTable.hideDownload).toBeFalsy(); 119fb726d48Sopenharmony_ci }); 120fb726d48Sopenharmony_ci 121fb726d48Sopenharmony_ci it('LitTablePageTest07', () => { 122fb726d48Sopenharmony_ci expect(litTable.selectable).not.toBeUndefined(); 123fb726d48Sopenharmony_ci }); 124fb726d48Sopenharmony_ci 125fb726d48Sopenharmony_ci it('LitTablePageTest08', () => { 126fb726d48Sopenharmony_ci litTable.selectable = true; 127fb726d48Sopenharmony_ci expect(litTable.selectable).toBeTruthy(); 128fb726d48Sopenharmony_ci }); 129fb726d48Sopenharmony_ci 130fb726d48Sopenharmony_ci it('LitTablePageTest09', () => { 131fb726d48Sopenharmony_ci expect(litTable.scrollY).not.toBeUndefined(); 132fb726d48Sopenharmony_ci }); 133fb726d48Sopenharmony_ci 134fb726d48Sopenharmony_ci it('LitTablePageTest10', () => { 135fb726d48Sopenharmony_ci litTable.scrollY = ''; 136fb726d48Sopenharmony_ci expect(litTable.scrollY).not.toBeUndefined(); 137fb726d48Sopenharmony_ci }); 138fb726d48Sopenharmony_ci 139fb726d48Sopenharmony_ci it('LitTablePageTest11', () => { 140fb726d48Sopenharmony_ci expect(litTable.recycleDataSource).not.toBeUndefined(); 141fb726d48Sopenharmony_ci }); 142fb726d48Sopenharmony_ci 143fb726d48Sopenharmony_ci it('LitTablePageTest12', () => { 144fb726d48Sopenharmony_ci expect(litTable.measureReset()).toBeUndefined(); 145fb726d48Sopenharmony_ci }); 146fb726d48Sopenharmony_ci 147fb726d48Sopenharmony_ci it('LitTablePageTest13', () => { 148fb726d48Sopenharmony_ci litTable.pagination = true; 149fb726d48Sopenharmony_ci expect(litTable.pagination).toBeTruthy(); 150fb726d48Sopenharmony_ci }); 151fb726d48Sopenharmony_ci 152fb726d48Sopenharmony_ci it('LitTablePageTest14', () => { 153fb726d48Sopenharmony_ci litTable.setAttribute('pagination', ''); 154fb726d48Sopenharmony_ci litTable.pagination = false; 155fb726d48Sopenharmony_ci expect(litTable.pagination).toBeFalsy(); 156fb726d48Sopenharmony_ci }); 157fb726d48Sopenharmony_ci 158fb726d48Sopenharmony_ci it('LitTablePageTest15', () => { 159fb726d48Sopenharmony_ci expect(litTable.initElements()).toBeUndefined(); 160fb726d48Sopenharmony_ci }); 161fb726d48Sopenharmony_ci 162fb726d48Sopenharmony_ci it('LitTablePageTest16', () => { 163fb726d48Sopenharmony_ci expect(litTable.initPageEventListener()).toBeUndefined(); 164fb726d48Sopenharmony_ci }); 165fb726d48Sopenharmony_ci 166fb726d48Sopenharmony_ci it('LitTablePageTest17', () => { 167fb726d48Sopenharmony_ci litTable.rememberScrollTop = true; 168fb726d48Sopenharmony_ci expect(litTable.toTop()).toBeUndefined(); 169fb726d48Sopenharmony_ci }); 170fb726d48Sopenharmony_ci 171fb726d48Sopenharmony_ci it('LitTablePageTest18', () => { 172fb726d48Sopenharmony_ci litTable.rememberScrollTop = true; 173fb726d48Sopenharmony_ci litTable.toTop(); 174fb726d48Sopenharmony_ci expect(litTable.tableElement!.scrollTop).toEqual(0); 175fb726d48Sopenharmony_ci expect(litTable.tableElement!.scrollLeft).toEqual(0); 176fb726d48Sopenharmony_ci }); 177fb726d48Sopenharmony_ci 178fb726d48Sopenharmony_ci it('LitTablePageTest19', () => { 179fb726d48Sopenharmony_ci litTable.rememberScrollTop = false; 180fb726d48Sopenharmony_ci litTable.toTop(); 181fb726d48Sopenharmony_ci expect(litTable.tableElement!.scrollTop).toEqual(0); 182fb726d48Sopenharmony_ci expect(litTable.tableElement!.scrollLeft).toEqual(0); 183fb726d48Sopenharmony_ci }); 184fb726d48Sopenharmony_ci 185fb726d48Sopenharmony_ci it('LitTablePageTest20', () => { 186fb726d48Sopenharmony_ci expect(typeof litTable.initHtml()).toEqual('string'); 187fb726d48Sopenharmony_ci }); 188fb726d48Sopenharmony_ci 189fb726d48Sopenharmony_ci it('LitTablePageTest21', () => { 190fb726d48Sopenharmony_ci expect(litTable.connectedCallback()).toBeUndefined(); 191fb726d48Sopenharmony_ci }); 192fb726d48Sopenharmony_ci 193fb726d48Sopenharmony_ci it('LitTablePageTest22', () => { 194fb726d48Sopenharmony_ci const rowData = { 195fb726d48Sopenharmony_ci data: [ 196fb726d48Sopenharmony_ci { 197fb726d48Sopenharmony_ci isSelected: undefined, 198fb726d48Sopenharmony_ci }, 199fb726d48Sopenharmony_ci ], 200fb726d48Sopenharmony_ci }; 201fb726d48Sopenharmony_ci expect(litTable.meauseElementHeight(rowData)).toBe(27); 202fb726d48Sopenharmony_ci }); 203fb726d48Sopenharmony_ci 204fb726d48Sopenharmony_ci it('LitTablePageTest23', () => { 205fb726d48Sopenharmony_ci const rowData = { 206fb726d48Sopenharmony_ci data: [ 207fb726d48Sopenharmony_ci { 208fb726d48Sopenharmony_ci isSelected: undefined, 209fb726d48Sopenharmony_ci }, 210fb726d48Sopenharmony_ci ], 211fb726d48Sopenharmony_ci }; 212fb726d48Sopenharmony_ci expect(litTable.meauseTreeElementHeight(rowData, 1)).toBe(27); 213fb726d48Sopenharmony_ci }); 214fb726d48Sopenharmony_ci 215fb726d48Sopenharmony_ci it('LitTablePageTest24', () => { 216fb726d48Sopenharmony_ci document.body.innerHTML = "<lit-table id='tab' tree></lit-table>"; 217fb726d48Sopenharmony_ci let table = document.querySelector('#tab') as LitPageTable; 218fb726d48Sopenharmony_ci let htmlElement = document.createElement('lit-table-column') as LitTableColumn; 219fb726d48Sopenharmony_ci htmlElement.setAttribute('title', '1'); 220fb726d48Sopenharmony_ci htmlElement.setAttribute('data-index', '1'); 221fb726d48Sopenharmony_ci htmlElement.setAttribute('key', '1'); 222fb726d48Sopenharmony_ci htmlElement.setAttribute('align', 'flex-start'); 223fb726d48Sopenharmony_ci htmlElement.setAttribute('height', '32px'); 224fb726d48Sopenharmony_ci table!.appendChild(htmlElement); 225fb726d48Sopenharmony_ci setTimeout(() => { 226fb726d48Sopenharmony_ci table.recycleDataSource = [ 227fb726d48Sopenharmony_ci { 228fb726d48Sopenharmony_ci id: 1, 229fb726d48Sopenharmony_ci name: 'name', 230fb726d48Sopenharmony_ci }, 231fb726d48Sopenharmony_ci { 232fb726d48Sopenharmony_ci id: 2, 233fb726d48Sopenharmony_ci name: 'nameValue', 234fb726d48Sopenharmony_ci }, 235fb726d48Sopenharmony_ci ]; 236fb726d48Sopenharmony_ci expect(table.meauseTreeElementHeight('1', 2)).toBe(27); 237fb726d48Sopenharmony_ci }, 20); 238fb726d48Sopenharmony_ci }); 239fb726d48Sopenharmony_ci 240fb726d48Sopenharmony_ci it('LitTablePageTest25', () => { 241fb726d48Sopenharmony_ci expect(litTable.createExpandBtn({ expanded: false, data: { status: true } })).not.toBeUndefined(); 242fb726d48Sopenharmony_ci }); 243fb726d48Sopenharmony_ci 244fb726d48Sopenharmony_ci it('LitTablePageTest26', () => { 245fb726d48Sopenharmony_ci let newTableElement = document.createElement('div'); 246fb726d48Sopenharmony_ci newTableElement.classList.add('tr'); 247fb726d48Sopenharmony_ci newTableElement.style.cursor = 'pointer'; 248fb726d48Sopenharmony_ci newTableElement.style.gridTemplateColumns = '1,2,3'; 249fb726d48Sopenharmony_ci newTableElement.style.position = 'absolute'; 250fb726d48Sopenharmony_ci newTableElement.style.top = '0px'; 251fb726d48Sopenharmony_ci newTableElement.style.left = '0px'; 252fb726d48Sopenharmony_ci litTable.currentRecycleList = [newTableElement]; 253fb726d48Sopenharmony_ci litTable.recycleDs = [{ rowHidden: false, data: { isSearch: true } }]; 254fb726d48Sopenharmony_ci litTable.tbodyElement = document.createElement('div'); 255fb726d48Sopenharmony_ci litTable.treeElement = document.createElement('div'); 256fb726d48Sopenharmony_ci litTable.tableElement = document.createElement('div'); 257fb726d48Sopenharmony_ci litTable.theadElement = document.createElement('div'); 258fb726d48Sopenharmony_ci expect(litTable.reMeauseHeight()).toBeUndefined(); 259fb726d48Sopenharmony_ci }); 260fb726d48Sopenharmony_ci 261fb726d48Sopenharmony_ci it('LitTablePageTest27', () => { 262fb726d48Sopenharmony_ci const rowData = { 263fb726d48Sopenharmony_ci data: [ 264fb726d48Sopenharmony_ci { 265fb726d48Sopenharmony_ci isSelected: undefined, 266fb726d48Sopenharmony_ci }, 267fb726d48Sopenharmony_ci ], 268fb726d48Sopenharmony_ci }; 269fb726d48Sopenharmony_ci litTable.columns.forEach = jest.fn(() => true); 270fb726d48Sopenharmony_ci expect(litTable.createNewTableElement(rowData)).not.toBeUndefined(); 271fb726d48Sopenharmony_ci }); 272fb726d48Sopenharmony_ci 273fb726d48Sopenharmony_ci it('LitTablePageTest28', () => { 274fb726d48Sopenharmony_ci let element = document.createElement('div'); 275fb726d48Sopenharmony_ci let ch = document.createElement('div'); 276fb726d48Sopenharmony_ci element.appendChild(ch); 277fb726d48Sopenharmony_ci let rowObject = { rowHidden: false, data: { isSearch: true } }; 278fb726d48Sopenharmony_ci let tableColmn = document.createElement('lit-table-column') as LitTableColumn; 279fb726d48Sopenharmony_ci tableColmn.setAttribute('data-index', '1'); 280fb726d48Sopenharmony_ci tableColmn.setAttribute('title', '1'); 281fb726d48Sopenharmony_ci tableColmn.setAttribute('data-index', '2'); 282fb726d48Sopenharmony_ci tableColmn.setAttribute('align', 'flex-start'); 283fb726d48Sopenharmony_ci tableColmn.setAttribute('height', '32px'); 284fb726d48Sopenharmony_ci tableColmn.setAttribute('key', '2'); 285fb726d48Sopenharmony_ci let tableColmn1 = document.createElement('lit-table-column') as LitTableColumn; 286fb726d48Sopenharmony_ci tableColmn1.setAttribute('align', 'flex-start'); 287fb726d48Sopenharmony_ci tableColmn1.setAttribute('height', '32px'); 288fb726d48Sopenharmony_ci tableColmn1.setAttribute('title', '2'); 289fb726d48Sopenharmony_ci tableColmn1.setAttribute('data-index', '2'); 290fb726d48Sopenharmony_ci tableColmn1.setAttribute('key', '2'); 291fb726d48Sopenharmony_ci litTable.columns = [tableColmn, tableColmn1]; 292fb726d48Sopenharmony_ci expect(litTable.freshCurrentLine(element, rowObject)).toBeUndefined(); 293fb726d48Sopenharmony_ci }); 294fb726d48Sopenharmony_ci 295fb726d48Sopenharmony_ci it('LitTablePageTest29', () => { 296fb726d48Sopenharmony_ci litTable.recycleDs.length = 1; 297fb726d48Sopenharmony_ci litTable.setCurrentSelection = jest.fn(() => true); 298fb726d48Sopenharmony_ci expect(litTable.scrollToData(litTable.recycleDataSource)).toBeUndefined(); 299fb726d48Sopenharmony_ci }); 300fb726d48Sopenharmony_ci 301fb726d48Sopenharmony_ci it('LitTablePageTest30', () => { 302fb726d48Sopenharmony_ci litTable.recycleDs = [{ rowHidden: false, data: { isSearch: true } }]; 303fb726d48Sopenharmony_ci let dataSource = [ 304fb726d48Sopenharmony_ci { 305fb726d48Sopenharmony_ci id: 11, 306fb726d48Sopenharmony_ci name: 'name', 307fb726d48Sopenharmony_ci }, 308fb726d48Sopenharmony_ci { 309fb726d48Sopenharmony_ci id: 21, 310fb726d48Sopenharmony_ci name: 'value', 311fb726d48Sopenharmony_ci }, 312fb726d48Sopenharmony_ci ]; 313fb726d48Sopenharmony_ci expect(litTable.expandList(dataSource)).toBeUndefined(); 314fb726d48Sopenharmony_ci }); 315fb726d48Sopenharmony_ci 316fb726d48Sopenharmony_ci it('LitTablePageTest31', () => { 317fb726d48Sopenharmony_ci expect(litTable.clearAllSelection()).toBeUndefined(); 318fb726d48Sopenharmony_ci }); 319fb726d48Sopenharmony_ci 320fb726d48Sopenharmony_ci it('LitTablePageTest32', () => { 321fb726d48Sopenharmony_ci expect(litTable.dispatchRowClickEvent({ data: { isSelected: '' } }, [], { button: '' })).toBeUndefined(); 322fb726d48Sopenharmony_ci }); 323fb726d48Sopenharmony_ci 324fb726d48Sopenharmony_ci it('LitTablePageTest33', () => { 325fb726d48Sopenharmony_ci litTable.treeElement = jest.fn(() => undefined); 326fb726d48Sopenharmony_ci litTable.treeElement.children = jest.fn(() => [1]); 327fb726d48Sopenharmony_ci litTable.columns.forEach = jest.fn(() => true); 328fb726d48Sopenharmony_ci litTable.treeElement.lastChild = jest.fn(() => true); 329fb726d48Sopenharmony_ci litTable.treeElement.lastChild.style = jest.fn(() => true); 330fb726d48Sopenharmony_ci expect(litTable.createNewTreeTableElement({ data: '' })).not.toBeUndefined(); 331fb726d48Sopenharmony_ci }); 332fb726d48Sopenharmony_ci 333fb726d48Sopenharmony_ci it('LitTablePageTest34', () => { 334fb726d48Sopenharmony_ci let tableIcon = document.createElement('lit-icon') as LitIcon; 335fb726d48Sopenharmony_ci let mouseClickEvent: MouseEvent = new MouseEvent('click', <MouseEventInit>{ movementX: 1, movementY: 2 }); 336fb726d48Sopenharmony_ci tableIcon.dispatchEvent(mouseClickEvent); 337fb726d48Sopenharmony_ci }); 338fb726d48Sopenharmony_ci 339fb726d48Sopenharmony_ci it('LitTablePageTest35', () => { 340fb726d48Sopenharmony_ci document.body.innerHTML = `<lit-table id="aaa"></lit-table>`; 341fb726d48Sopenharmony_ci let litTable = document.querySelector('#aaa') as LitTable; 342fb726d48Sopenharmony_ci litTable.formatName = true; 343fb726d48Sopenharmony_ci expect(litTable.formatName).toBeTruthy(); 344fb726d48Sopenharmony_ci }); 345fb726d48Sopenharmony_ci 346fb726d48Sopenharmony_ci it('LitTablePageTest36', () => { 347fb726d48Sopenharmony_ci expect(litTable.formatExportData(litTable.recycleDataSource)).not.toBeUndefined(); 348fb726d48Sopenharmony_ci }); 349fb726d48Sopenharmony_ci 350fb726d48Sopenharmony_ci it('LitTablePageTest37', () => { 351fb726d48Sopenharmony_ci expect(litTable.setSelectedRow(true, [])).toBeUndefined(); 352fb726d48Sopenharmony_ci }); 353fb726d48Sopenharmony_ci 354fb726d48Sopenharmony_ci it('LitTablePageTest38', () => { 355fb726d48Sopenharmony_ci let tableColmn = document.createElement('lit-table-column') as LitTableColumn; 356fb726d48Sopenharmony_ci tableColmn.setAttribute('title', '21'); 357fb726d48Sopenharmony_ci tableColmn.setAttribute('data-index', '13'); 358fb726d48Sopenharmony_ci tableColmn.setAttribute('key', '4'); 359fb726d48Sopenharmony_ci tableColmn.setAttribute('align', 'flex-start'); 360fb726d48Sopenharmony_ci tableColmn.setAttribute('height', '32px'); 361fb726d48Sopenharmony_ci let tableColmn1 = document.createElement('lit-table-column') as LitTableColumn; 362fb726d48Sopenharmony_ci tableColmn1.setAttribute('title', '52'); 363fb726d48Sopenharmony_ci tableColmn1.setAttribute('data-index', '244'); 364fb726d48Sopenharmony_ci tableColmn1.setAttribute('key', '25'); 365fb726d48Sopenharmony_ci tableColmn1.setAttribute('align', 'flex-start'); 366fb726d48Sopenharmony_ci tableColmn1.setAttribute('height', '24px'); 367fb726d48Sopenharmony_ci 368fb726d48Sopenharmony_ci let tableColmn2 = document.createElement('lit-table-column') as LitTableColumn; 369fb726d48Sopenharmony_ci tableColmn2.setAttribute('title', '53'); 370fb726d48Sopenharmony_ci tableColmn2.setAttribute('data-index', '35'); 371fb726d48Sopenharmony_ci tableColmn2.setAttribute('key', '35'); 372fb726d48Sopenharmony_ci tableColmn2.setAttribute('align', 'flex-start'); 373fb726d48Sopenharmony_ci tableColmn2.setAttribute('height', '325px'); 374fb726d48Sopenharmony_ci litTable.columns = [tableColmn, tableColmn1, tableColmn2]; 375fb726d48Sopenharmony_ci let dataSource = [ 376fb726d48Sopenharmony_ci { 377fb726d48Sopenharmony_ci id: 22, 378fb726d48Sopenharmony_ci name: 'name', 379fb726d48Sopenharmony_ci }, 380fb726d48Sopenharmony_ci { 381fb726d48Sopenharmony_ci id: 12, 382fb726d48Sopenharmony_ci name: 'nameValue', 383fb726d48Sopenharmony_ci }, 384fb726d48Sopenharmony_ci ]; 385fb726d48Sopenharmony_ci expect(litTable.formatExportData(dataSource)).toBeTruthy(); 386fb726d48Sopenharmony_ci }); 387fb726d48Sopenharmony_ci 388fb726d48Sopenharmony_ci it('LitTablePageTest39', () => { 389fb726d48Sopenharmony_ci let element = document.createElement('div'); 390fb726d48Sopenharmony_ci litTable.tableElement = document.createElement('div'); 391fb726d48Sopenharmony_ci let firstElement = document.createElement('div'); 392fb726d48Sopenharmony_ci let ch = document.createElement('div'); 393fb726d48Sopenharmony_ci element.appendChild(ch); 394fb726d48Sopenharmony_ci let rowObject = { rowHidden: false, data: { isSearch: true } }; 395fb726d48Sopenharmony_ci let tableColmn = document.createElement('lit-table-column') as LitTableColumn; 396fb726d48Sopenharmony_ci tableColmn.setAttribute('height', '32px'); 397fb726d48Sopenharmony_ci tableColmn.setAttribute('title', '16'); 398fb726d48Sopenharmony_ci tableColmn.setAttribute('data-index', '1'); 399fb726d48Sopenharmony_ci tableColmn.setAttribute('align', 'flex-start'); 400fb726d48Sopenharmony_ci tableColmn.setAttribute('height', '36px'); 401fb726d48Sopenharmony_ci tableColmn.setAttribute('key', '1'); 402fb726d48Sopenharmony_ci let tableColmn1 = document.createElement('lit-table-column') as LitTableColumn; 403fb726d48Sopenharmony_ci tableColmn1.setAttribute('key', '2'); 404fb726d48Sopenharmony_ci tableColmn1.setAttribute('align', 'flex-start'); 405fb726d48Sopenharmony_ci tableColmn1.setAttribute('height', '32px'); 406fb726d48Sopenharmony_ci tableColmn1.setAttribute('title', '2'); 407fb726d48Sopenharmony_ci tableColmn1.setAttribute('data-index', '2'); 408fb726d48Sopenharmony_ci litTable.columns = [tableColmn, tableColmn1]; 409fb726d48Sopenharmony_ci expect(litTable.freshCurrentLine(element, rowObject, firstElement)).toBeUndefined(); 410fb726d48Sopenharmony_ci }); 411fb726d48Sopenharmony_ci it('LitTablePageTest40', () => { 412fb726d48Sopenharmony_ci litTable.hideDownload = true; 413fb726d48Sopenharmony_ci expect(litTable.hideDownload).toBeTruthy(); 414fb726d48Sopenharmony_ci }); 415fb726d48Sopenharmony_ci it('LitTablePageTest41', () => { 416fb726d48Sopenharmony_ci litTable.hideDownload = false; 417fb726d48Sopenharmony_ci expect(litTable.hideDownload).not.toBeUndefined(); 418fb726d48Sopenharmony_ci }); 419fb726d48Sopenharmony_ci it('LitTablePageTest42', () => { 420fb726d48Sopenharmony_ci expect(litTable.createBtn({ expanded: false, data: { status: true } })).not.toBeUndefined(); 421fb726d48Sopenharmony_ci }); 422fb726d48Sopenharmony_ci it('LitTablePageTest43', () => { 423fb726d48Sopenharmony_ci expect(litTable.mouseOut()).toBeUndefined(); 424fb726d48Sopenharmony_ci }); 425fb726d48Sopenharmony_ci it('LitTablePageTest44', () => { 426fb726d48Sopenharmony_ci expect(litTable.setCurrentHover({})).toBeUndefined(); 427fb726d48Sopenharmony_ci }); 428fb726d48Sopenharmony_ci it('LitTablePageTest45', () => { 429fb726d48Sopenharmony_ci expect(litTable.clearAllHover({})).toBeUndefined(); 430fb726d48Sopenharmony_ci }); 431fb726d48Sopenharmony_ci}); 432