fix tests

This commit is contained in:
Denys Vuika 2016-11-23 20:38:32 +00:00 committed by Mario Romano
parent 22071a7ff9
commit dc1a6ae4e6

View File

@ -19,10 +19,8 @@ import { CoreModule } from 'ng2-alfresco-core';
import { ActivitiFormModule } from './../../../index'; import { ActivitiFormModule } from './../../../index';
import { ComponentFixture, TestBed, async } from '@angular/core/testing'; import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { FormFieldComponent } from './form-field.component'; import { FormFieldComponent } from './form-field.component';
// import { WidgetVisibilityService } from './../../services/widget-visibility.service';
import { FormRenderingService } from './../../services/form-rendering.service'; import { FormRenderingService } from './../../services/form-rendering.service';
// import { WidgetComponent } from './../widgets/widget.component'; import { FormModel, FormFieldModel, FormFieldTypes } from './../widgets/core/index';
import { FormFieldModel, FormFieldTypes } from './../widgets/core/index';
import { TextWidget, CheckboxWidget } from './../widgets/index'; import { TextWidget, CheckboxWidget } from './../widgets/index';
describe('FormFieldComponent', () => { describe('FormFieldComponent', () => {
@ -30,9 +28,9 @@ describe('FormFieldComponent', () => {
let fixture: ComponentFixture<FormFieldComponent>; let fixture: ComponentFixture<FormFieldComponent>;
let component: FormFieldComponent; let component: FormFieldComponent;
let componentHandler: any; let componentHandler: any;
let form: FormModel;
let formRenderingService: FormRenderingService; let formRenderingService: FormRenderingService;
// let visibilityService: WidgetVisibilityService;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
@ -51,10 +49,11 @@ describe('FormFieldComponent', () => {
fixture = TestBed.createComponent(FormFieldComponent); fixture = TestBed.createComponent(FormFieldComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
formRenderingService = fixture.debugElement.injector.get(FormRenderingService); formRenderingService = fixture.debugElement.injector.get(FormRenderingService);
form = new FormModel();
}); });
it('should create default component instance', () => { it('should create default component instance', () => {
let field = new FormFieldModel(null, { let field = new FormFieldModel(form, {
type: FormFieldTypes.TEXT type: FormFieldTypes.TEXT
}); });
@ -66,7 +65,7 @@ describe('FormFieldComponent', () => {
}); });
it('should create custom component instance', () => { it('should create custom component instance', () => {
let field = new FormFieldModel(null, { let field = new FormFieldModel(form, {
type: FormFieldTypes.TEXT type: FormFieldTypes.TEXT
}); });
@ -86,7 +85,7 @@ describe('FormFieldComponent', () => {
}); });
it('should require component type to be resolved', () => { it('should require component type to be resolved', () => {
let field = new FormFieldModel(null, { let field = new FormFieldModel(form, {
type: FormFieldTypes.TEXT type: FormFieldTypes.TEXT
}); });