Skip to content

Commit

Permalink
Encode formDefinition with jsonString context (#1242)
Browse files Browse the repository at this point in the history
* Encode formDefinition with jsonString context

* Encode formDefinition with jsonString context

* updated the proxy component to point to v2 version of page and wrote a test case to check the json emitted in case of eds servlet originated request

* Encode formDefinition with jsonString context

* updated the proxy component to point to v2 version of page and wrote a test case to check the json emitted in case of eds servlet originated request

* updated the proxy component to point to v2 version of page and wrote a test case to check the json emitted in case of eds servlet originated request

* updated the proxy component to point to v2 version of page and wrote a test case to check the json emitted in case of eds servlet originated request

---------

Co-authored-by: Deep Prakash Dewanji <[email protected]>
  • Loading branch information
TalmizAhmed and Deep Prakash Dewanji authored Jun 5, 2024
1 parent e0481b5 commit 4a55a33
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
jcr:description="Page Component for the Forms Components Library"
jcr:primaryType="cq:Component"
jcr:title="Page"
sling:resourceSuperType="core/fd/components/page/v1/page"
sling:resourceSuperType="core/fd/components/page/v2/page"
componentGroup=".hidden"/>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"FT_FORMS-12052",
"FT_FORMS-13209",
"FT_FORMS-11581",
"FT_FORMS-14545"
"FT_FORMS-14545",
"FT_SITES-19631"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
jcr:language="en"
jcr:primaryType="cq:PageContent"
jcr:title="Page Edge Delivery"
sling:configRef="/conf/forms/afv2/"
sling:configRef="/conf/core-components-it/samples/customfunctionedgedelivery/"
cq:conf="/conf/core-components-it"
sling:resourceType="core/fd/components/page/v2/page">
<guideContainer
fd:version="2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
data-sly-test.isEdgeDeliveryRequest="${formUtil.edgeDeliveryRequest}">
<div>
<div>
<pre>
<code>${formstructparser.formDefinition}</code>
</pre>
<pre>
<code>"${formstructparser.formDefinition @ context='jsonString'}"</code>
</pre>
</div>
</div>
</div>
Expand Down
20 changes: 20 additions & 0 deletions ui.tests/test-module/specs/page/pagev2.runtime.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,23 @@ describe("Form with Page component version 2", () => {
cy.get("html body main form").should("exist");
})
})

describe("Form with Page component version 2 for eds rendering", () => {
const pagePath = "/bin/franklin.delivery/adobe-rnd/aem-boilerplate-forms/main/content/forms/af/core-components-it/samples/page/afv2.html"
beforeEach(() => {
cy.openPage(pagePath);
});

it(" form should get rendered with main tag in body and should have pre code tags ", () => {
cy.get("html body main div div div pre code").should("exist");
cy.get("html body main div div div pre code").then(($codeEle)=>{
const encodedJson=$codeEle.get()[0].innerHTML;
const formJson=JSON.parse(JSON.parse(encodedJson));
expect(formJson).to.have.property("id");
expect(formJson).to.have.property("fieldType");
expect(formJson).to.have.property(":items");
expect(formJson).to.have.property("title");

})
})
})

0 comments on commit 4a55a33

Please sign in to comment.