Updated to angular 11
Now compiling with strict mode in typescript Need to error checking now
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
|
||||
import { PaxComponent } from './pax.component';
|
||||
|
||||
@ -6,11 +6,13 @@ describe('PaxComponent', () => {
|
||||
let component: PaxComponent;
|
||||
let fixture: ComponentFixture<PaxComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [PaxComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [PaxComponent],
|
||||
}).compileComponents();
|
||||
}),
|
||||
);
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PaxComponent);
|
||||
|
||||
@ -15,7 +15,10 @@ export class PaxComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public data: number,
|
||||
private fb: FormBuilder,
|
||||
) {
|
||||
this.createForm();
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
pax: '',
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -24,12 +27,6 @@ export class PaxComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
pax: '',
|
||||
});
|
||||
}
|
||||
|
||||
accept(): void {
|
||||
const { pax } = this.form.value;
|
||||
this.dialogRef.close(pax);
|
||||
|
||||
Reference in New Issue
Block a user