1
0

Customer JDL

This commit is contained in:
Michael Hierweck
2019-04-18 16:18:26 +02:00
parent bd5bb859d9
commit c6be30895e
206 changed files with 33 additions and 16148 deletions

View File

@@ -1,60 +0,0 @@
/* tslint:disable max-line-length */
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { HttpResponse } from '@angular/common/http';
import { of } from 'rxjs';
import { HsadminNgTestModule } from '../../../test.module';
import { AssetUpdateComponent } from 'app/entities/asset/asset-update.component';
import { AssetService } from 'app/entities/asset/asset.service';
import { Asset } from 'app/shared/model/asset.model';
describe('Component Tests', () => {
describe('Asset Management Update Component', () => {
let comp: AssetUpdateComponent;
let fixture: ComponentFixture<AssetUpdateComponent>;
let service: AssetService;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HsadminNgTestModule],
declarations: [AssetUpdateComponent]
})
.overrideTemplate(AssetUpdateComponent, '')
.compileComponents();
fixture = TestBed.createComponent(AssetUpdateComponent);
comp = fixture.componentInstance;
service = fixture.debugElement.injector.get(AssetService);
});
describe('save', () => {
it('Should call update service on save for existing entity', fakeAsync(() => {
// GIVEN
const entity = new Asset(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.asset = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
it('Should call create service on save for new entity', fakeAsync(() => {
// GIVEN
const entity = new Asset();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.asset = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
});
});
});