From c218608d6805e0413557de89a26347a799349801 Mon Sep 17 00:00:00 2001 From: starg09 Date: Wed, 25 Oct 2023 02:33:00 -0300 Subject: [PATCH] Arreglos menores de tests --- src/components/asignar/asignar.component.spec.ts | 6 ++++++ src/components/nuevaTarea/nuevaTarea.component.spec.ts | 6 ++++++ src/components/tareas/tareas.component.spec.ts | 6 ++++++ src/util/errorHandler.ts | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/asignar/asignar.component.spec.ts b/src/components/asignar/asignar.component.spec.ts index 5d590c7..1e96890 100644 --- a/src/components/asignar/asignar.component.spec.ts +++ b/src/components/asignar/asignar.component.spec.ts @@ -11,6 +11,10 @@ import { httpClientSpy, tareaPrincipal } from 'src/services/httpClientSpy' import { FilterTareas } from '../../pipes/filterTareas.pipe' import { usuarioAsignatario } from './../../services/httpClientSpy' import { AsignarComponent } from './asignar.component' +import { UsuariosService } from 'src/services/usuarios.service' +import { UsuariosMockService } from 'src/services/ususarios.mock.service' +import { TareasMockService } from 'src/services/tareas.mock.service' +import { TareasService } from 'src/services/tareas.service' const updatedTaskId = 1 @@ -46,6 +50,8 @@ describe('AsignarComponent', async () => { } }, { provide: Router, useValue: routerSpy }, + { provide: UsuariosService, useClass: UsuariosMockService}, + { provide: TareasService, useClass: TareasMockService} ] }) .compileComponents() diff --git a/src/components/nuevaTarea/nuevaTarea.component.spec.ts b/src/components/nuevaTarea/nuevaTarea.component.spec.ts index 12995d5..7b008dc 100644 --- a/src/components/nuevaTarea/nuevaTarea.component.spec.ts +++ b/src/components/nuevaTarea/nuevaTarea.component.spec.ts @@ -10,6 +10,10 @@ import { httpClientSpy } from 'src/services/httpClientSpy' import { ValidationFieldComponent } from './../validationField/validationField.component' import { NuevaTareaComponent } from './nuevaTarea.component' import { DpDatePickerModule, ISelectionEvent } from 'ng2-date-picker' +import { UsuariosService } from 'src/services/usuarios.service' +import { UsuariosMockService } from 'src/services/ususarios.mock.service' +import { TareasService } from 'src/services/tareas.service' +import { TareasMockService } from 'src/services/tareas.mock.service' describe('NuevaTareaComponent', () => { let component: NuevaTareaComponent @@ -34,6 +38,8 @@ describe('NuevaTareaComponent', () => { providers: [ { provide: HttpClient, useValue: httpClientSpy }, { provide: Router, useValue: routerSpy }, + { provide: UsuariosService, useClass: UsuariosMockService}, + { provide: TareasService, useClass: TareasMockService} ] }) .compileComponents() diff --git a/src/components/tareas/tareas.component.spec.ts b/src/components/tareas/tareas.component.spec.ts index a0b5fdd..8a1e937 100644 --- a/src/components/tareas/tareas.component.spec.ts +++ b/src/components/tareas/tareas.component.spec.ts @@ -14,6 +14,10 @@ import { IconsModule } from '../../app/icons.module' import { FilterTareas } from '../../pipes/filterTareas.pipe' import { OrderTareas } from '../../pipes/orderTareas.pipe' import { TareasComponent } from './tareas.component' +import { UsuariosService } from 'src/services/usuarios.service' +import { TareasService } from 'src/services/tareas.service' +import { TareasMockService } from 'src/services/tareas.mock.service' +import { UsuariosMockService } from 'src/services/ususarios.mock.service' // /** Registramos el locale ES para formatear nĂºmeros */ @@ -57,6 +61,8 @@ describe('TareasComponent', () => { set: { providers: [ { provide: Router, useValue: routerSpy, }, + { provide: UsuariosService, useClass: UsuariosMockService}, + { provide: TareasService, useClass: TareasMockService} ] } }) diff --git a/src/util/errorHandler.ts b/src/util/errorHandler.ts index 8ba5271..fb4f53d 100644 --- a/src/util/errorHandler.ts +++ b/src/util/errorHandler.ts @@ -12,4 +12,4 @@ export function mostrarError(component: any, error: any): void { setTimeout(() => { component.errors.length = 0 }, 5000) -} +} \ No newline at end of file