Skip to content

Commit

Permalink
Fix FE CI
Browse files Browse the repository at this point in the history
  • Loading branch information
smolegz committed Oct 2, 2024
1 parent f197a13 commit 9920576
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions peer-prep-fe/src/app/admin/admin.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { HttpClientTestingModule } from '@angular/common/http/testing';
import { AdminComponent } from './admin.component';

describe('AdminComponent', () => {
Expand All @@ -8,7 +8,7 @@ describe('AdminComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AdminComponent]
imports: [AdminComponent, HttpClientTestingModule]
})
.compileComponents();

Expand Down
4 changes: 3 additions & 1 deletion peer-prep-fe/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { FormsModule } from '@angular/forms';
import { QuestionListComponent } from '../components/question-list/question-list.component';
import { authService } from './authService/authService';
import { AdminComponent } from './admin/admin.component';
import { HttpClientModule } from '@angular/common/http';

const MODULES = [
CommonModule,
Expand All @@ -17,7 +18,8 @@ const MODULES = [
FormsModule,
QuestionListComponent,
CommonModule,
AdminComponent
AdminComponent,
HttpClientModule
];

@Component({
Expand Down
1 change: 1 addition & 0 deletions peer-prep-fe/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const appConfig: ApplicationConfig = {
provideOAuthClient(),
provideAnimationsAsync(), provideAnimationsAsync(), provideAnimationsAsync(),
importProvidersFrom(HttpClientModule),
HttpClientModule,
{provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }
]
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { TestBed } from '@angular/core/testing';

import { AuthInterceptorService } from './auth-interceptor.service';
import { AuthInterceptor } from './auth-interceptor.service';

describe('AuthInterceptorService', () => {
let service: AuthInterceptorService;
let service: AuthInterceptor;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AuthInterceptorService);
service = TestBed.inject(AuthInterceptor);
});

it('should be created', () => {
Expand Down
4 changes: 2 additions & 2 deletions peer-prep-fe/src/app/login/login.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { RouterTestingModule } from "@angular/router/testing";
import { LoginComponent } from './login.component';

describe('LoginComponent', () => {
Expand All @@ -8,7 +8,7 @@ describe('LoginComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [LoginComponent]
imports: [LoginComponent, RouterTestingModule]
})
.compileComponents();

Expand Down
9 changes: 5 additions & 4 deletions peer-prep-fe/src/app/userService/user-service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ describe('UserService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ HttpClientTestingModule ]
})});

httpClient = TestBed.inject(HttpClient);
httpTestingController = TestBed.inject(HttpTestingController);
})

httpClient = TestBed.get(HttpClient);
httpTestingController = TestBed.get(HttpTestingController);
});

it('should create an instance', () => {
expect(new UserService(httpClient)).toBeTruthy();
Expand Down

0 comments on commit 9920576

Please sign in to comment.