BETTERZON-83: FE unit testing (#35)

* BETTERZON-83: Making pre-generated unit tests work

* BETTERZON-83: Writing unit tests for angular to improve code coverage
This commit is contained in:
Patrick
2021-05-02 15:58:47 +02:00
committed by GitHub
parent a3ac897818
commit e9d03b9cbb
25 changed files with 692 additions and 21126 deletions
@@ -1,25 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import { ImprintComponent } from './imprint.component';
import {ImprintComponent} from './imprint.component';
describe('ImprintComponent', () => {
let component: ImprintComponent;
let fixture: ComponentFixture<ImprintComponent>;
let component: ImprintComponent;
let fixture: ComponentFixture<ImprintComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ImprintComponent ]
})
.compileComponents();
});
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ImprintComponent]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ImprintComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => {
fixture = TestBed.createComponent(ImprintComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,25 +1,35 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import { LandingpageComponent } from './landingpage.component';
import {LandingpageComponent} from './landingpage.component';
import {RouterTestingModule} from "@angular/router/testing";
import {Router} from "@angular/router";
describe('LandingpageComponent', () => {
let component: LandingpageComponent;
let fixture: ComponentFixture<LandingpageComponent>;
let component: LandingpageComponent;
let fixture: ComponentFixture<LandingpageComponent>;
let router = {
navigate: jasmine.createSpy('navigate'),
routerState: jasmine.createSpy('routerState')
}
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LandingpageComponent ]
})
.compileComponents();
});
beforeEach(async () => {
await TestBed.configureTestingModule({
providers: [{provide: Router, useValue: router}],
declarations: [LandingpageComponent],
imports: [
RouterTestingModule
]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(LandingpageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => {
fixture = TestBed.createComponent(LandingpageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,25 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import { PageNotFoundPageComponent } from './page-not-found-page.component';
import {PageNotFoundPageComponent} from './page-not-found-page.component';
describe('PageNotFoundPageComponent', () => {
let component: PageNotFoundPageComponent;
let fixture: ComponentFixture<PageNotFoundPageComponent>;
let component: PageNotFoundPageComponent;
let fixture: ComponentFixture<PageNotFoundPageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PageNotFoundPageComponent ]
})
.compileComponents();
});
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [PageNotFoundPageComponent]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PageNotFoundPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => {
fixture = TestBed.createComponent(PageNotFoundPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,25 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import { PrivacyComponent } from './privacy.component';
import {PrivacyComponent} from './privacy.component';
describe('PrivacyComponent', () => {
let component: PrivacyComponent;
let fixture: ComponentFixture<PrivacyComponent>;
let component: PrivacyComponent;
let fixture: ComponentFixture<PrivacyComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PrivacyComponent ]
})
.compileComponents();
});
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [PrivacyComponent]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PrivacyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => {
fixture = TestBed.createComponent(PrivacyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,25 +1,29 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import { ProductDetailPageComponent } from './product-detail-page.component';
import {ProductDetailPageComponent} from './product-detail-page.component';
import {RouterTestingModule} from "@angular/router/testing";
describe('ProductDetailPageComponent', () => {
let component: ProductDetailPageComponent;
let fixture: ComponentFixture<ProductDetailPageComponent>;
let component: ProductDetailPageComponent;
let fixture: ComponentFixture<ProductDetailPageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ProductDetailPageComponent ]
})
.compileComponents();
});
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ProductDetailPageComponent],
imports: [
RouterTestingModule
]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ProductDetailPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => {
fixture = TestBed.createComponent(ProductDetailPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,25 +1,32 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import { ProductSearchPageComponent } from './product-search-page.component';
import {ProductSearchPageComponent} from './product-search-page.component';
import {HeaderComponent} from "../../components/header/header.component";
import {FooterComponent} from "../../components/footer/footer.component";
import {ProductListComponent} from "../../components/product-list/product-list.component";
import {RouterTestingModule} from "@angular/router/testing";
describe('ProductSearchPageComponent', () => {
let component: ProductSearchPageComponent;
let fixture: ComponentFixture<ProductSearchPageComponent>;
let component: ProductSearchPageComponent;
let fixture: ComponentFixture<ProductSearchPageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ProductSearchPageComponent ]
})
.compileComponents();
});
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ProductSearchPageComponent],
imports: [
RouterTestingModule
]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ProductSearchPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => {
fixture = TestBed.createComponent(ProductSearchPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});