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 cd79259 commit 127831f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormTextEditorComponent } from './form-text-editor.component';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { APP_BASE_HREF } from '@angular/common';
import { QuillModule } from "ngx-quill";
import * as _ from 'lodash';

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

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

beforeEach(() => {
fixture = TestBed.createComponent(FormTextEditorComponent);
component = fixture.componentInstance;
component.field = { "type": "editor", "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-text-editor',
templateUrl: 'form-text-editor.component.html',
template: require('./form-text-editor.component.html'),
styles: [require('./form-text-editor.component.scss').toString()]
})
export class FormTextEditorComponent implements Field {
Expand Down

0 comments on commit 127831f

Please sign in to comment.