Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Commit

Permalink
fix(test): add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kyxyes committed Aug 13, 2018
1 parent e2b0892 commit cd79259
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/app/components/form-radio/form-radio.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { FormGroup } from '@angular/forms';
import { FieldConfig } from '../../models/field-config.interface';
import * as _ from 'lodash';



@Component({
selector: 'form-radio',
template: require('./form-radio.component.html')
Expand Down
37 changes: 37 additions & 0 deletions src/app/components/form-textarea/form-textarea.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormTextareaComponent } from "./form-textarea.component";
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { APP_BASE_HREF } from '@angular/common';
import * as _ from 'lodash';

describe('FormTextareaComponent', () => {
let component: FormTextareaComponent;
let fixture: ComponentFixture<FormTextareaComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
FormsModule,
ReactiveFormsModule
],
declarations: [FormTextareaComponent],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' }
]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(FormTextareaComponent);
component = fixture.componentInstance;
component.field = { "type": "textarea", "label": "Explain", "name": "testName", "hidden": true, "required": true };

fixture.detectChanges();
});

it('should be created', () => {
expect(component).toBeTruthy();
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FieldConfig } from '../../models/field-config.interface';

@Component({
selector: 'form-textarea',
templateUrl: './form-textarea.component.html'
template: require('./form-textarea.component.html')
})
export class FormTextareaComponent implements Field {
field: FieldConfig;
Expand Down

0 comments on commit cd79259

Please sign in to comment.