6. Test AddAttendeeComponent
In this section we will test our new feature component and it's reactive form.
1. Fix broken tests for the EventComponent
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EventComponent } from './event.component';
import { NO_ERRORS_SCHEMA } from '@angular/compiler/src/core';
describe('EventComponent', () => {
let component: EventComponent;
let fixture: ComponentFixture<EventComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [EventComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EventComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
2. Add ReactiveFormsModule to AddAttendeeComponent spec file
3. Add test to check our form validation is working
StackBlitz Link
Last updated