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

@@ -12,22 +12,24 @@ import { of } from 'rxjs';
describe('AppViewComponent', () => {
let component: AppViewComponent;
let fixture: ComponentFixture<AppViewComponent>;
let authClient: jasmine.SpyObj<AuthClient>;
beforeEach(() => {
const authSpy = jasmine.createSpyObj('AuthClient', ['check'])
const pushSpy = jasmine.createSpyObj('SwPush', ['requestSubscription'])
const updatesSpy = jasmine.createSpyObj('UpdatesService', ['postNotif'])
const updatesSpy = jasmine.createSpyObj('UpdatesService', {
newsCheck: of()
})
TestBed.configureTestingModule({
declarations: [AppViewComponent],
providers: [{provide: AuthClient, useValue: authSpy},
{provide: SwPush, useValue: pushSpy},
{provide: UpdatesService, useValue: updatesSpy}],
providers: [
{provide: AuthClient, useValue: authSpy},
{provide: SwPush, useValue: pushSpy},
{provide: UpdatesService, useValue: updatesSpy}
],
imports: [MatTabsModule, RouterModule.forRoot([]), MatIconModule]
});
fixture = TestBed.createComponent(AppViewComponent);
component = fixture.componentInstance;
authClient = TestBed.inject(AuthClient) as jasmine.SpyObj<AuthClient>
fixture.detectChanges();
});