Skip to content

Commit

Permalink
Arreglos menores de tests
Browse files Browse the repository at this point in the history
  • Loading branch information
starg09 committed Oct 25, 2023
1 parent 82dd6a6 commit c218608
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/components/asignar/asignar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -46,6 +50,8 @@ describe('AsignarComponent', async () => {
}
},
{ provide: Router, useValue: routerSpy },
{ provide: UsuariosService, useClass: UsuariosMockService},
{ provide: TareasService, useClass: TareasMockService}
]
})
.compileComponents()
Expand Down
6 changes: 6 additions & 0 deletions src/components/nuevaTarea/nuevaTarea.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,6 +38,8 @@ describe('NuevaTareaComponent', () => {
providers: [
{ provide: HttpClient, useValue: httpClientSpy },
{ provide: Router, useValue: routerSpy },
{ provide: UsuariosService, useClass: UsuariosMockService},
{ provide: TareasService, useClass: TareasMockService}
]
})
.compileComponents()
Expand Down
6 changes: 6 additions & 0 deletions src/components/tareas/tareas.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -57,6 +61,8 @@ describe('TareasComponent', () => {
set: {
providers: [
{ provide: Router, useValue: routerSpy, },
{ provide: UsuariosService, useClass: UsuariosMockService},
{ provide: TareasService, useClass: TareasMockService}
]
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/util/errorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export function mostrarError(component: any, error: any): void {
setTimeout(() => {
component.errors.length = 0
}, 5000)
}
}

0 comments on commit c218608

Please sign in to comment.