diff --git a/lib/core/src/lib/form/components/form-renderer.component.spec.ts b/lib/core/src/lib/form/components/form-renderer.component.spec.ts index dd8f789afe..6b00784efb 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.spec.ts +++ b/lib/core/src/lib/form/components/form-renderer.component.spec.ts @@ -422,6 +422,29 @@ describe('Form Renderer Component', () => { expect(fullWidthElement.style['width']).toBe('100%'); }); + it('[C309872] - Should display Text widget spans on 2 columns when colspan is set to 2', () => { + formRendererComponent.formDefinition = formService.parseForm(colspanForm.formRepresentation.formDefinition, null, false, false); + fixture.detectChanges(); + + const twoSpanTextWidgetContainerId = '#field-1ff21afc-7df4-4607-8363-1dc8576e1c8e-container'; + const oneSpanTextWidgetContainerId = '#field-f4285ad-g123-1a73-521d-7nm4a7231aul0-container'; + + const formSizedElement = fixture.nativeElement.querySelector( + `${oneSpanTextWidgetContainerId} section.adf-grid-list-column-view` + ); + expectElementToBeVisible(formSizedElement); + const sectionGridElement: HTMLElement[] = fixture.nativeElement.querySelectorAll( + `${oneSpanTextWidgetContainerId} section .adf-grid-list-single-column` + ); + sectionGridElement.forEach((element) => { + expect(element.style['width']).toBe('50%'); + }); + const fullWidthElement = fixture.nativeElement.querySelector( + `${twoSpanTextWidgetContainerId} section.adf-grid-list-column-view .adf-grid-list-single-column` + ); + expect(fullWidthElement.style['width']).toBe('100%'); + }); + it('[C309655] - Should display validation error message when Number widget has invalid value', async () => { formRendererComponent.formDefinition = formService.parseForm(numberNotRequiredForm.formRepresentation.formDefinition); fixture.detectChanges(); diff --git a/lib/core/src/lib/form/components/mock/form-renderer.component.mock.ts b/lib/core/src/lib/form/components/mock/form-renderer.component.mock.ts index 1f952b8049..41e10f86b5 100644 --- a/lib/core/src/lib/form/components/mock/form-renderer.component.mock.ts +++ b/lib/core/src/lib/form/components/mock/form-renderer.component.mock.ts @@ -908,7 +908,7 @@ export const colspanForm = { 1: [ { id: 'Text04sjhr', - name: 'Text', + name: 'TextColspan', type: 'text', readOnly: false, required: false, @@ -925,6 +925,51 @@ export const colspanForm = { } ] } + }, + { + id: 'f4285ad-g123-1a73-521d-7nm4a7231aul0', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Text01dask', + name: 'Text', + type: 'text', + readOnly: false, + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ], + 2: [ + { + id: 'Text02ds21', + name: 'Text', + type: 'text', + readOnly: false, + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ] + } } ], outcomes: [],