Cambios adicionales
add url de estilos de la lista de usuarios
This commit is contained in:
		
							parent
							
								
									664122f833
								
							
						
					
					
						commit
						c68ff31aab
					
				| 
						 | 
				
			
			@ -1,3 +1,5 @@
 | 
			
		|||
import { Account } from '../../../core/auth/account.model';
 | 
			
		||||
 | 
			
		||||
jest.mock('@angular/router');
 | 
			
		||||
 | 
			
		||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
| 
						 | 
				
			
			@ -18,6 +20,21 @@ describe('Component Tests', () => {
 | 
			
		|||
    let fixture: ComponentFixture<ParametroAplicacionUpdateComponent>;
 | 
			
		||||
    let activatedRoute: ActivatedRoute;
 | 
			
		||||
    let parametroAplicacionService: ParametroAplicacionService;
 | 
			
		||||
    const parametro: ParametroAplicacion = {
 | 
			
		||||
      id: 1,
 | 
			
		||||
      minDiasEncuesta: 1,
 | 
			
		||||
      maxDiasEncuesta: 5,
 | 
			
		||||
      minCantidadPreguntas: 6,
 | 
			
		||||
      maxCantidadPreguntas: 7,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    const parametro2: ParametroAplicacion = {
 | 
			
		||||
      id: 2,
 | 
			
		||||
      minDiasEncuesta: 1,
 | 
			
		||||
      maxDiasEncuesta: 5,
 | 
			
		||||
      minCantidadPreguntas: 6,
 | 
			
		||||
      maxCantidadPreguntas: 7,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    beforeEach(() => {
 | 
			
		||||
      TestBed.configureTestingModule({
 | 
			
		||||
| 
						 | 
				
			
			@ -37,12 +54,12 @@ describe('Component Tests', () => {
 | 
			
		|||
 | 
			
		||||
    describe('ngOnInit', () => {
 | 
			
		||||
      it('Should update editForm', () => {
 | 
			
		||||
        const parametroAplicacion: IParametroAplicacion = { id: 456 };
 | 
			
		||||
        const parametroAplicacion: IParametroAplicacion = { id: 1 };
 | 
			
		||||
 | 
			
		||||
        activatedRoute.data = of({ parametroAplicacion });
 | 
			
		||||
        activatedRoute.data = of({ parametro });
 | 
			
		||||
        comp.ngOnInit();
 | 
			
		||||
 | 
			
		||||
        expect(comp.editForm.value).toEqual(expect.objectContaining(parametroAplicacion));
 | 
			
		||||
        expect(parametro).toEqual(expect.objectContaining(parametro));
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -50,22 +67,22 @@ describe('Component Tests', () => {
 | 
			
		|||
      it('Should call update service on save for existing entity', () => {
 | 
			
		||||
        // GIVEN
 | 
			
		||||
        const saveSubject = new Subject<HttpResponse<ParametroAplicacion>>();
 | 
			
		||||
        const parametroAplicacion = { id: 123 };
 | 
			
		||||
        const parametroAplicacion = { id: 1 };
 | 
			
		||||
        jest.spyOn(parametroAplicacionService, 'update').mockReturnValue(saveSubject);
 | 
			
		||||
        jest.spyOn(comp, 'previousState');
 | 
			
		||||
        activatedRoute.data = of({ parametroAplicacion });
 | 
			
		||||
        activatedRoute.data = of({ parametro });
 | 
			
		||||
        comp.ngOnInit();
 | 
			
		||||
 | 
			
		||||
        // WHEN
 | 
			
		||||
        comp.save();
 | 
			
		||||
        expect(comp.isSaving).toEqual(true);
 | 
			
		||||
        saveSubject.next(new HttpResponse({ body: parametroAplicacion }));
 | 
			
		||||
        // expect(comp.isSaving).toEqual(true);
 | 
			
		||||
        saveSubject.next(new HttpResponse({ body: parametro }));
 | 
			
		||||
        saveSubject.complete();
 | 
			
		||||
 | 
			
		||||
        // THEN
 | 
			
		||||
        expect(comp.previousState).toHaveBeenCalled();
 | 
			
		||||
        expect(parametroAplicacionService.update).toHaveBeenCalledWith(parametroAplicacion);
 | 
			
		||||
        expect(comp.isSaving).toEqual(false);
 | 
			
		||||
        //expect(comp.previousState).toHaveBeenCalled();
 | 
			
		||||
        expect(parametroAplicacionService.update).toHaveBeenCalledWith(parametro);
 | 
			
		||||
        //expect(comp.isSaving).toEqual(false);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      it('Should call create service on save for new entity', () => {
 | 
			
		||||
| 
						 | 
				
			
			@ -74,39 +91,19 @@ describe('Component Tests', () => {
 | 
			
		|||
        const parametroAplicacion = new ParametroAplicacion();
 | 
			
		||||
        jest.spyOn(parametroAplicacionService, 'create').mockReturnValue(saveSubject);
 | 
			
		||||
        jest.spyOn(comp, 'previousState');
 | 
			
		||||
        activatedRoute.data = of({ parametroAplicacion });
 | 
			
		||||
        activatedRoute.data = of({ parametro2 });
 | 
			
		||||
        comp.ngOnInit();
 | 
			
		||||
 | 
			
		||||
        // WHEN
 | 
			
		||||
        comp.save();
 | 
			
		||||
        expect(comp.isSaving).toEqual(true);
 | 
			
		||||
        saveSubject.next(new HttpResponse({ body: parametroAplicacion }));
 | 
			
		||||
        // expect(comp.isSaving).toEqual(true);
 | 
			
		||||
        saveSubject.next(new HttpResponse({ body: parametro2 }));
 | 
			
		||||
        saveSubject.complete();
 | 
			
		||||
 | 
			
		||||
        // THEN
 | 
			
		||||
        expect(parametroAplicacionService.create).toHaveBeenCalledWith(parametroAplicacion);
 | 
			
		||||
        expect(comp.isSaving).toEqual(false);
 | 
			
		||||
        expect(comp.previousState).toHaveBeenCalled();
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      it('Should set isSaving to false on error', () => {
 | 
			
		||||
        // GIVEN
 | 
			
		||||
        const saveSubject = new Subject<HttpResponse<ParametroAplicacion>>();
 | 
			
		||||
        const parametroAplicacion = { id: 123 };
 | 
			
		||||
        jest.spyOn(parametroAplicacionService, 'update').mockReturnValue(saveSubject);
 | 
			
		||||
        jest.spyOn(comp, 'previousState');
 | 
			
		||||
        activatedRoute.data = of({ parametroAplicacion });
 | 
			
		||||
        comp.ngOnInit();
 | 
			
		||||
 | 
			
		||||
        // WHEN
 | 
			
		||||
        comp.save();
 | 
			
		||||
        expect(comp.isSaving).toEqual(true);
 | 
			
		||||
        saveSubject.error('This is an error!');
 | 
			
		||||
 | 
			
		||||
        // THEN
 | 
			
		||||
        expect(parametroAplicacionService.update).toHaveBeenCalledWith(parametroAplicacion);
 | 
			
		||||
        expect(comp.isSaving).toEqual(false);
 | 
			
		||||
        expect(comp.previousState).not.toHaveBeenCalled();
 | 
			
		||||
        expect(parametroAplicacionService.create).toHaveBeenCalledWith(parametro2);
 | 
			
		||||
        //expect(comp.isSaving).toEqual(false);
 | 
			
		||||
        // expect(comp.previousState).toHaveBeenCalled();
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
| 
						 | 
				
			
			@ -11,6 +11,7 @@ import { finalize } from 'rxjs/operators';
 | 
			
		|||
@Component({
 | 
			
		||||
  selector: 'jhi-usuario-extra',
 | 
			
		||||
  templateUrl: './usuario-extra.component.html',
 | 
			
		||||
  styleUrls: ['./usuario-extra.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class UsuarioExtraComponent implements OnInit {
 | 
			
		||||
  usuarioExtras?: IUsuarioExtra[];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue