forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.component.spec.ts
More file actions
38 lines (32 loc) · 1.12 KB
/
app.component.spec.ts
File metadata and controls
38 lines (32 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
let app: AppComponent;
let fixture: ComponentFixture<AppComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent],
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
app = fixture.componentInstance;
fixture.detectChanges();
});
it('should create the app', () => {
expect(app).toBeTruthy();
});
it(`should have as title 'DSOMM'`, () => {
expect(app.title).toEqual('DSOMM');
});
it('check for fork me on github ribbon generation', () => {
const fixture = TestBed.createComponent(AppComponent);
const HTMLElement: HTMLElement = fixture.nativeElement;
var divTag = HTMLElement.querySelector('div')!;
var aTag = divTag.querySelector('a')!;
//console.log(aTag);
expect(aTag.textContent).toEqual('Fork me on GitHub');
});
});