1/* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16import {ComponentFixture, TestBed} from '@angular/core/testing'; 17import {MatIconModule} from '@angular/material/icon'; 18import {WebAdbComponent} from './web_adb_component'; 19 20describe('WebAdbComponent', () => { 21 let fixture: ComponentFixture<WebAdbComponent>; 22 let component: WebAdbComponent; 23 let htmlElement: HTMLElement; 24 25 beforeEach(async () => { 26 await TestBed.configureTestingModule({ 27 imports: [MatIconModule], 28 declarations: [WebAdbComponent], 29 }).compileComponents(); 30 fixture = TestBed.createComponent(WebAdbComponent); 31 component = fixture.componentInstance; 32 htmlElement = fixture.nativeElement; 33 }); 34 35 it('can be created', () => { 36 expect(component).toBeTruthy(); 37 }); 38 39 it('renders the info message', () => { 40 fixture.detectChanges(); 41 expect(htmlElement.querySelector('.adb-info')?.innerHTML).toBe( 42 'Add new device', 43 ); 44 expect(htmlElement.querySelector('.adb-icon')?.innerHTML).toBe('info'); 45 }); 46}); 47