AAE-23116 Dropdown should not display errors / call apis when it's in readOnly state [without refactor] (#9800)

* AAE-23116 Add tests for dropdown widget

* AAE-23116 Update form-field.model

* AAE-23116 Final

* AAE-23116 Restore formatting

* AAE-23116 Align with comments

* AAE-23116 Update

* AAE-23116 Fix process-services-cloud unit tests

* AAE-23116 Fix process services unit tests

* AAE-23116 Fix for core unit tests
This commit is contained in:
Wiktor Danielewski
2024-06-21 08:50:55 +02:00
committed by GitHub
parent 328d233b05
commit 4d2c489508
7 changed files with 395 additions and 344 deletions

View File

@@ -944,10 +944,13 @@ describe('FormComponent', () => {
const formValues: any = {};
formValues.dropdownId = {
id: 'option_2',
name: 'test2'
id: 'dropdown_option_2',
name: 'Dropdown option 2'
};
formValues.radio = {
id: 'radio_option_3',
name: 'Radio option 3'
};
formValues.radio = { id: 'option_2', name: 'Option 2' };
const change = new SimpleChange(null, formValues, false);
formComponent.data = formValues;
formComponent.ngOnChanges({ data: change });
@@ -956,9 +959,9 @@ describe('FormComponent', () => {
dropdownField = formFields.find((field) => field.id === 'dropdownId');
radioField = formFields.find((field) => field.id === 'radio');
expect(dropdownField.value.id).toBe('option_2');
expect(dropdownField.value.name).toBe('test2');
expect(radioField.value).toBe('option_2');
expect(dropdownField.value).toBe('dropdown_option_2');
expect(radioField.value.id).toBe('radio_option_3');
expect(radioField.value.name).toBe('Radio option 3');
});
it('should refresh radio buttons value when id is given to data', () => {