fix: Fixed test units

This commit is contained in:
2025-06-04 16:24:18 +02:00
parent 9f97e584bd
commit c525dfe1c1
39 changed files with 632 additions and 82 deletions

View File

@@ -3,23 +3,30 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PersonalComponent } from './personal.component';
import { AuthClient } from 'src/app/services/auth.client';
import { MatDialogModule } from '@angular/material/dialog';
import { SwUpdate } from '@angular/service-worker';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatListModule } from '@angular/material/list';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
import { AppUpdateService } from 'src/app/services/app-update.service';
import { of } from 'rxjs';
import { MatIconModule } from '@angular/material/icon';
describe('PersonalComponent', () => {
let component: PersonalComponent;
let fixture: ComponentFixture<PersonalComponent>;
let auMock: jasmine.SpyObj<AppUpdateService>
beforeEach(() => {
auMock = jasmine.createSpyObj("aumock", {
checkForUpdate: of()
})
const authMock = jasmine.createSpyObj('AuthClient', ['s'])
TestBed.configureTestingModule({
declarations: [PersonalComponent],
providers: [
{provide: AuthClient, useValue: authMock},
{provide: AppUpdateService, useValue: auMock}
],
imports: [MatDialogModule, MatSnackBarModule, MatListModule, BrowserAnimationsModule]
imports: [MatDialogModule, MatSnackBarModule, MatListModule, NoopAnimationsModule, MatIconModule]
});
fixture = TestBed.createComponent(PersonalComponent);
component = fixture.componentInstance;