diff --git a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv3/basic/.content.xml b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv3/basic/.content.xml index ae42f6453d..ecafd8d44d 100644 --- a/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv3/basic/.content.xml +++ b/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/fileinput/fileinputv3/basic/.content.xml @@ -85,6 +85,7 @@ name="fileinput5" readOnly="{Boolean}true" textIsRich="[true,true]" + maxFileSize="2" type="file[]" visible="{Boolean}true"/> { if (selectedWidgetValues.includes((widget.value))) { widget.checked = true - widget.setAttribute(FormView.Constants.HTML_ATTRS.CHECKED, FormView.Constants.HTML_ATTRS.CHECKED) - widget.setAttribute(FormView.Constants.ARIA_CHECKED, true) + widget.setAttribute(FormView.Constants.HTML_ATTRS.CHECKED, FormView.Constants.HTML_ATTRS.CHECKED); } else { widget.checked = false widget.removeAttribute(FormView.Constants.HTML_ATTRS.CHECKED); - widget.setAttribute(FormView.Constants.ARIA_CHECKED, false); } }, this) super.updateEmptyStatus(); diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v1/radiobutton/clientlibs/site/js/radiobuttonview.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v1/radiobutton/clientlibs/site/js/radiobuttonview.js index 3d7cceb25f..ee8875bd28 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v1/radiobutton/clientlibs/site/js/radiobuttonview.js +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/radiobutton/v1/radiobutton/clientlibs/site/js/radiobuttonview.js @@ -133,11 +133,9 @@ if (modelValue != null && widget.value != null && (modelValue.toString() == widget.value.toString())) { widget.checked = true; widget.setAttribute(FormView.Constants.HTML_ATTRS.CHECKED, FormView.Constants.HTML_ATTRS.CHECKED); - widget.setAttribute(FormView.Constants.ARIA_CHECKED, true); } else { widget.checked = false; widget.removeAttribute(FormView.Constants.HTML_ATTRS.CHECKED); - widget.setAttribute(FormView.Constants.ARIA_CHECKED, false); } }, this) super.updateEmptyStatus(); diff --git a/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html b/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html index 90cdf0164e..0f15903462 100644 --- a/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html +++ b/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html @@ -70,8 +70,10 @@ { cy.get('.cmp-adaptiveform-container').should('have.length', 1); cy.get('.cmp-adaptiveform-container').find('.cmp-adaptiveform-textinput__widget').should('have.length', 11); }) + + it('Test iframe src with dataRef', () => { + cy.get('.cmp-aemform__iframecontent').should('have.attr', 'src').should('not.include', "wcmmode"); + }); }) context('aem embed container in iframe mode with custom height ', function () { @@ -124,5 +128,6 @@ describe("Sites with Aem Embed Container", () => { expect(fragmentTextInputModel.getState().value).to.equal(input) }) }) + }) }) diff --git a/ui.tests/test-module/specs/checkbox/checkbox.runtime.cy.js b/ui.tests/test-module/specs/checkbox/checkbox.runtime.cy.js index 89ec8cc398..1ae2992b6b 100644 --- a/ui.tests/test-module/specs/checkbox/checkbox.runtime.cy.js +++ b/ui.tests/test-module/specs/checkbox/checkbox.runtime.cy.js @@ -125,6 +125,7 @@ describe("Form Runtime with CheckBox Input", () => { cy.get(`#${id}`).find(".cmp-adaptiveform-checkbox__errormessage").should('have.text',"This is a custom required checkbox") cy.get(`#${id} > div.${bemBlock}__errormessage`).should('have.attr', 'id', `${id}__errormessage`) cy.get(`#${id} > .${bemBlock}__widget-container > .${bemBlock}__widget`).should('have.attr', 'aria-describedby', `${id}__errormessage`) + cy.get(`#${id} > .${bemBlock}__widget-container > .${bemBlock}__widget`).should('not.have.attr', 'aria-checked') cy.get(`#${id} > .${bemBlock}__widget-container > .${bemBlock}__widget`).should('have.attr', 'aria-invalid', 'true') }) diff --git a/ui.tests/test-module/specs/checkboxgroup/checkboxgroup.runtime.cy.js b/ui.tests/test-module/specs/checkboxgroup/checkboxgroup.runtime.cy.js index 4b7d2f47d0..eb8133969a 100644 --- a/ui.tests/test-module/specs/checkboxgroup/checkboxgroup.runtime.cy.js +++ b/ui.tests/test-module/specs/checkboxgroup/checkboxgroup.runtime.cy.js @@ -158,6 +158,7 @@ describe("Form Runtime with CheckBoxGroup Input", () => { cy.get(`#${checkBox5}`).find("input").uncheck().check(["1"]) cy.get(`#${checkBox5}`).find(".cmp-adaptiveform-checkboxgroup__errormessage").should('have.text',"Please enter a valid value.") cy.get(`#${checkBox5}`).should('have.attr', 'data-cmp-valid', 'false') + cy.get(`#${checkBox5}`).find(".cmp-adaptiveform-checkboxgroup__widget").should('not.have.attr', 'aria-checked') cy.get(`#${checkBox5}`).find(".cmp-adaptiveform-checkboxgroup__widget").should('have.attr', 'aria-describedby', `${checkBox5}__errormessage`) }) diff --git a/ui.tests/test-module/specs/fileinput/fileinput.runtime.cy.js b/ui.tests/test-module/specs/fileinput/fileinput.runtime.cy.js index 454251cec0..10cd39a289 100644 --- a/ui.tests/test-module/specs/fileinput/fileinput.runtime.cy.js +++ b/ui.tests/test-module/specs/fileinput/fileinput.runtime.cy.js @@ -290,7 +290,7 @@ describe("Form with File Input - Prefill & Submit tests", () => { if (idx === 0) { cy.on('window:alert', (str) => { - expect(str).to.equal('File(s) $test.bat are unsupported file types'); + expect(str).to.equal('File(s) test.bat are unsupported file types'); }); } else { // check for successful attachment of file in the view diff --git a/ui.tests/test-module/specs/fileinput/fileinputv3.runtime.cy.js b/ui.tests/test-module/specs/fileinput/fileinputv3.runtime.cy.js index 6b22949cc5..d13bfd4a25 100644 --- a/ui.tests/test-module/specs/fileinput/fileinputv3.runtime.cy.js +++ b/ui.tests/test-module/specs/fileinput/fileinputv3.runtime.cy.js @@ -224,7 +224,23 @@ describe('Click on button tag (V-3)', () => { cy.get(`#${id} > .${bemBlock}__container > .${bemBlock}__dragarea > .${bemBlock}__widgetlabel`).should('exist').click().then(() => { cy.attachFile(`#${id} input[type="file"]`, [sampleFileName]).then(() => { cy.get('.cmp-adaptiveform-fileinput__filename').should('contain', sampleFileName); + }); }); + }); + it('should display an alert if the file size exceeds the maximum allowed size', () => { + // Define the maximum file size (in bytes, e.g., 2MB) + const maxFileSize = 2 * 1024 * 1024; // 2MB + + // Set up a stub for the alert message + const expectedAlertMessage = `File(s) FileAttachment3mb.jpg are greater than the expected size: ${maxFileSize / (1024 * 1024)}MBMB.`; + + const fileInput = 'input[name=\'fileinput5\']'; + cy.attachFile(fileInput, ['FileAttachment3mb.jpg']); + + // Stub the window alert function + cy.on('window:alert', (alertText) => { + expect(alertText).to.equal(expectedAlertMessage); + }); + }); - }); }) \ No newline at end of file diff --git a/ui.tests/test-module/specs/radiobutton/radiobutton.runtime.cy.js b/ui.tests/test-module/specs/radiobutton/radiobutton.runtime.cy.js index 0861dd1f7a..f2e8c1e7ae 100644 --- a/ui.tests/test-module/specs/radiobutton/radiobutton.runtime.cy.js +++ b/ui.tests/test-module/specs/radiobutton/radiobutton.runtime.cy.js @@ -106,6 +106,7 @@ describe("Form with Radio Button Input", () => { cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__errormessage").should('have.text',""); cy.get(`#${id}`).should('have.attr', 'data-cmp-valid', 'true') cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__option__widget").should('have.attr', 'aria-invalid', 'false'); + cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__option__widget").should('not.have.attr', 'aria-checked'); cy.get(`#${id}`).find(".cmp-adaptiveform-radiobutton__widget").should('have.attr', 'aria-describedby', ''); }); });