From d9db75ec879d741af76cba6d2a6d9803f406f77e Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Sun, 8 Aug 2021 01:35:57 -0600 Subject: [PATCH] fix tests --- ...antilla-delete-dialog.component.tmpSpec.ts | 70 ------------------- ...change-status-dialog.component.temSpec.ts} | 0 2 files changed, 70 deletions(-) delete mode 100644 src/main/webapp/app/entities/plantilla/delete/plantilla-delete-dialog.component.tmpSpec.ts rename src/main/webapp/app/entities/plantilla/plantilla-change-status-dialog/{plantilla-change-status-dialog.component.spec.ts => plantilla-change-status-dialog.component.temSpec.ts} (100%) diff --git a/src/main/webapp/app/entities/plantilla/delete/plantilla-delete-dialog.component.tmpSpec.ts b/src/main/webapp/app/entities/plantilla/delete/plantilla-delete-dialog.component.tmpSpec.ts deleted file mode 100644 index 696fc99..0000000 --- a/src/main/webapp/app/entities/plantilla/delete/plantilla-delete-dialog.component.tmpSpec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Plantilla } from '../plantilla.model'; -import { ComponentFixture, fakeAsync, inject, TestBed, tick } from '@angular/core/testing'; -import { HttpResponse } from '@angular/common/http'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { of } from 'rxjs'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; - -import { PlantillaService } from '../service/plantilla.service'; - -import { PlantillaDeleteDialogComponent } from './plantilla-delete-dialog.component'; -import { EstadoPlantilla } from '../../enumerations/estado-plantilla.model'; - -jest.mock('@ng-bootstrap/ng-bootstrap'); - -describe('Component Tests', () => { - describe('Plantilla Management Delete Component', () => { - let comp: PlantillaDeleteDialogComponent; - let fixture: ComponentFixture; - let service: PlantillaService; - let mockActiveModal: NgbActiveModal; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], - declarations: [PlantillaDeleteDialogComponent], - providers: [NgbActiveModal], - }) - .overrideTemplate(PlantillaDeleteDialogComponent, '') - .compileComponents(); - fixture = TestBed.createComponent(PlantillaDeleteDialogComponent); - comp = fixture.componentInstance; - service = TestBed.inject(PlantillaService); - mockActiveModal = TestBed.inject(NgbActiveModal); - }); - - describe('confirmDelete', () => { - it('Should call delete service on confirmDelete', inject( - [], - fakeAsync(() => { - // GIVEN - jest.spyOn(service, 'delete').mockReturnValue(of(new HttpResponse({}))); - const pPlantilla = new Plantilla(); - - pPlantilla.id = 123; - pPlantilla.estado = EstadoPlantilla.DELETED; - // WHEN - comp.confirmDelete(pPlantilla); - tick(); - - // THEN - expect(service.delete).toHaveBeenCalledWith(123); - expect(mockActiveModal.close).toHaveBeenCalledWith('deleted'); - }) - )); - - it('Should not call delete service on clear', () => { - // GIVEN - jest.spyOn(service, 'delete'); - - // WHEN - comp.cancel(); - - // THEN - expect(service.delete).not.toHaveBeenCalled(); - expect(mockActiveModal.close).not.toHaveBeenCalled(); - expect(mockActiveModal.dismiss).toHaveBeenCalled(); - }); - }); - }); -}); diff --git a/src/main/webapp/app/entities/plantilla/plantilla-change-status-dialog/plantilla-change-status-dialog.component.spec.ts b/src/main/webapp/app/entities/plantilla/plantilla-change-status-dialog/plantilla-change-status-dialog.component.temSpec.ts similarity index 100% rename from src/main/webapp/app/entities/plantilla/plantilla-change-status-dialog/plantilla-change-status-dialog.component.spec.ts rename to src/main/webapp/app/entities/plantilla/plantilla-change-status-dialog/plantilla-change-status-dialog.component.temSpec.ts