eliminar test dado que no se ejecuta de esa manera ahora

This commit is contained in:
Eduardo Quiros 2021-07-16 22:56:51 -06:00
parent 8e7430d3f9
commit c4ecc4ac0a
No known key found for this signature in database
GPG Key ID: B77F36C3F12720B4
1 changed files with 0 additions and 65 deletions

View File

@ -1,65 +0,0 @@
jest.mock('@ng-bootstrap/ng-bootstrap');
import { ComponentFixture, TestBed, inject, fakeAsync, 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 { CategoriaService } from '../service/categoria.service';
import { CategoriaDeleteDialogComponent } from './categoria-delete-dialog.component';
describe('Component Tests', () => {
describe('Categoria Management Delete Component', () => {
let comp: CategoriaDeleteDialogComponent;
let fixture: ComponentFixture<CategoriaDeleteDialogComponent>;
let service: CategoriaService;
let mockActiveModal: NgbActiveModal;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
declarations: [CategoriaDeleteDialogComponent],
providers: [NgbActiveModal],
})
.overrideTemplate(CategoriaDeleteDialogComponent, '')
.compileComponents();
fixture = TestBed.createComponent(CategoriaDeleteDialogComponent);
comp = fixture.componentInstance;
service = TestBed.inject(CategoriaService);
mockActiveModal = TestBed.inject(NgbActiveModal);
});
describe('confirmDelete', () => {
it('Should call delete service on confirmDelete', inject(
[],
fakeAsync(() => {
// GIVEN
jest.spyOn(service, 'delete').mockReturnValue(of(new HttpResponse({})));
// WHEN
comp.confirmDelete(123);
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();
});
});
});
});