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 { QuantityComponent } from './quantity.component';
|
||||
|
||||
@ -6,11 +6,13 @@ describe('QuantityComponent', () => {
|
||||
let component: QuantityComponent;
|
||||
let fixture: ComponentFixture<QuantityComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [QuantityComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [QuantityComponent],
|
||||
}).compileComponents();
|
||||
}),
|
||||
);
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(QuantityComponent);
|
||||
|
||||
@ -18,7 +18,10 @@ export class QuantityComponent implements OnInit {
|
||||
private fb: FormBuilder,
|
||||
private math: MathService,
|
||||
) {
|
||||
this.createForm();
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
quantity: '',
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -27,12 +30,6 @@ export class QuantityComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
quantity: '',
|
||||
});
|
||||
}
|
||||
|
||||
accept(): void {
|
||||
const quantity = this.math.parseAmount(this.form.value.quantity);
|
||||
this.dialogRef.close(quantity);
|
||||
|
||||
Reference in New Issue
Block a user