fixed more tests

This commit is contained in:
lotte
2020-02-04 12:36:17 +01:00
parent d1b7f07c68
commit 34c5d93a98
7 changed files with 22 additions and 26 deletions

View File

@@ -92,7 +92,6 @@ function init() {
groupFactory: () => {
return [
new DynamicInputModel({
id: 'bootstrapArrayGroupInput',
placeholder: 'example array group input',
readOnly: false
@@ -363,7 +362,7 @@ describe('FormComponent test suite', () => {
spyOn((formComp as any).formService, 'validateAllFormFields');
form.next(formState.testForm)
form.next(formState.testForm);
formFixture.detectChanges();
formComp.onSubmit();
@@ -419,7 +418,7 @@ describe('FormComponent test suite', () => {
}));
it('should dispatch FormChangeAction when an item has been removed from an array', inject([FormBuilderService], (service: FormBuilderService) => {
formComp.removeItem(new Event('click'), formComp.formModel[0] as DynamicFormArrayModel, 0);
formComp.removeItem(new Event('click'), formComp.formModel[0] as DynamicFormArrayModel, 1);
expect(store.dispatch).toHaveBeenCalledWith(new FormChangeAction('testFormArray', service.getValueFromModel(formComp.formModel)));
}));
@@ -427,7 +426,7 @@ describe('FormComponent test suite', () => {
it('should emit removeArrayItem Event when an item has been removed from an array', inject([FormBuilderService], (service: FormBuilderService) => {
spyOn(formComp.removeArrayItem, 'emit');
formComp.removeItem(new Event('click'), formComp.formModel[0] as DynamicFormArrayModel, 0);
formComp.removeItem(new Event('click'), formComp.formModel[0] as DynamicFormArrayModel, 1);
expect(formComp.removeArrayItem.emit).toHaveBeenCalled();
}));