Speed up build (#1852)

* single build webpack

* fix demo shell test
This commit is contained in:
Eugenio Romano
2017-05-03 13:01:00 +02:00
committed by Eugenio Romano
parent 8959476941
commit 0b246b8211
362 changed files with 2684 additions and 13104 deletions

View File

@@ -39,7 +39,7 @@ describe('DisplayValueWidget', () => {
logService = new LogServiceMock();
formService = new FormService(null, null, logService);
visibilityService = new WidgetVisibilityService(null, logService);
widget = new DisplayValueWidget(formService, visibilityService, logService);
widget = new DisplayValueWidget(formService, visibilityService);
});
it('should require field to setup default value', () => {
@@ -387,14 +387,12 @@ describe('DisplayValueWidget', () => {
expect(widget.value).toBe('100');
});
it('should handle rest error', () => {
it('should handle rest error', (done) => {
const error = 'ERROR';
spyOn(formService, 'getRestFieldValues').and.returnValue(
Observable.throw(error)
);
spyOn(logService, 'error').and.stub();
let form = new FormModel({taskId: '<id>'});
widget.field = new FormFieldModel(form, {
@@ -407,10 +405,12 @@ describe('DisplayValueWidget', () => {
}
}
});
widget.error.subscribe(() => {
expect(formService.getRestFieldValues).toHaveBeenCalled();
expect(widget.value).toBe('100');
done();
});
widget.ngOnInit();
expect(formService.getRestFieldValues).toHaveBeenCalled();
expect(logService.error).toHaveBeenCalledWith(error);
expect(widget.value).toBe('100');
});
it('should setup [DATE] field with valid date', () => {