Skip to content

Commit

Permalink
Corrección de errores en el archivo 'auth.service.spec.ts'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yul1b3th committed Jun 29, 2024
1 parent 2d6f6f2 commit a8fd227
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/services/auth.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { User } from '../models/user.model'
import { type TokenService } from './token.service'
import { type Router } from '@angular/router'
import { type CookieService } from 'ngx-cookie-service'
import { type UserService } from './user.service'

describe('AuthService', () => {
let authService: AuthService
Expand All @@ -28,6 +29,7 @@ describe('AuthService', () => {
let httpClient: HttpClient
let httpClientMock: HttpTestingController
let tokenServiceMock: TokenService
let userServiceMock: UserService

beforeEach(() => {
TestBed.configureTestingModule({
Expand Down Expand Up @@ -62,7 +64,11 @@ describe('AuthService', () => {
value: cookieServiceMock
})

authService = new AuthService(httpClient, routerMock as unknown as Router, cookieServiceMock as unknown as CookieService, tokenServiceMock)
userServiceMock = {
userLoggedIn: false
} as unknown as UserService

authService = new AuthService(httpClient, routerMock as unknown as Router, cookieServiceMock as unknown as CookieService, tokenServiceMock, userServiceMock)
})

it('should return the current user when user is NOT FOUND in cookies', (done) => {
Expand Down

0 comments on commit a8fd227

Please sign in to comment.