import { TestBed } from '@angular/core/testing'; import { AppComponent } from './app.component'; import { By } from '@angular/platform-browser'; describe('AppComponent', () => { it('létrehozható az app objektum', () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app).toBeTruthy(); }); it('van nav elem', () => { const fixture = TestBed.createComponent(AppComponent); const nav = fixture.debugElement.queryAll(By.css('nav')); expect(nav.length).toBe(1); }); it('van nav elemben két div elem', () => { const fixture = TestBed.createComponent(AppComponent); const nav_div = fixture.debugElement.queryAll(By.css('nav div')) expect(nav_div.length).toBe(2); }); });