mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2026-05-26 12:38:03 +00:00
Merge remote-tracking branch 'origin/develop' into BETTERZON-78
# Conflicts: # Frontend/angular.json # Frontend/package-lock.json # Frontend/src/app/app.module.ts # Frontend/src/styles.css
This commit is contained in:
@@ -1,25 +1,42 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import { FooterComponent } from './footer.component';
|
||||
import {FooterComponent} from './footer.component';
|
||||
import {RouterTestingModule} from "@angular/router/testing";
|
||||
import {AppComponent} from "../../app.component";
|
||||
import {ImprintComponent} from "../../pages/imprint/imprint.component";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
|
||||
describe('FooterComponent', () => {
|
||||
let component: FooterComponent;
|
||||
let fixture: ComponentFixture<FooterComponent>;
|
||||
let component: FooterComponent;
|
||||
let fixture: ComponentFixture<FooterComponent>;
|
||||
let router = {
|
||||
navigate: jasmine.createSpy('navigate'),
|
||||
routerState: jasmine.createSpy('routerState')
|
||||
}
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ FooterComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
providers: [{provide: Router, useValue: router}],
|
||||
declarations: [FooterComponent],
|
||||
imports: [
|
||||
RouterTestingModule
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(FooterComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(FooterComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should navigate to /impressum when navigateImprint() is called', () => {
|
||||
component.navigateImprint();
|
||||
expect(router.navigate).toHaveBeenCalledWith(['/impressum']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ export class FooterComponent implements OnInit {
|
||||
}
|
||||
|
||||
navigateImprint(): void {
|
||||
this.router.navigate([('/impressum/')]);
|
||||
this.router.navigate([('/impressum')]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user