Skip to content

Commit

Permalink
Merge pull request #1231 from adobe/devtomaster_10May2024
Browse files Browse the repository at this point in the history
Devtomaster 10 may2024
  • Loading branch information
barshat7 committed May 10, 2024
2 parents 01924b5 + 65568ce commit 601db25
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .circleci/docker-compose.yml
Expand Up @@ -6,7 +6,7 @@ services:
entrypoint: tail -f /dev/null # Keeps the container running

circleci-aem-cloudready:
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:15860-1-openjdk11
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:7f6c9fff9b-openjdk11
depends_on:
- circleci-qp
# Add any additional configurations or environment variables if needed
Expand Down
Expand Up @@ -124,6 +124,11 @@ public List<Resource> getFragmentChildren() {
return filteredChildComponents;
}

@JsonIgnore
public Resource getFragmentContainer() {
return fragmentContainer;
}

@JsonIgnore
public String getFragmentTitle() {
String fragmentTitle = "";
Expand Down
Expand Up @@ -43,4 +43,12 @@ public interface Fragment extends Panel {
* @since com.adobe.cq.forms.core.components.models.form 4.4.0
*/
List<Resource> getFragmentChildren();

/**
* Returns fragment container resource
*
* @return
* @since com.adobe.cq.forms.core.components.models.form 5.4.1
*/
Resource getFragmentContainer();
}
Expand Up @@ -111,6 +111,14 @@ void testFragmentChildren() {
assertEquals("textinput", fragment.getFragmentChildren().get(0).getName());
}

@Test
void testFragmentContainerResource() {
Fragment fragment = Utils.getComponentUnderTest(PATH_FRAGMENT, Fragment.class, context);
Resource fragmentContainer = fragment.getFragmentContainer();
assertNotNull(fragmentContainer);
assertEquals("/content/affragment/jcr:content/guideContainer", fragmentContainer.getPath());
}

@Test
void testJSONExport() throws Exception {
Fragment fragment = Utils.getComponentUnderTest(PATH_FRAGMENT, Fragment.class, context);
Expand Down
Expand Up @@ -30,6 +30,21 @@
sling:resourceType="forms-components-examples/components/form/textinput"
fieldType="text-input"
name="fragmenttextinput"/>
<textinput1
jcr:created="{Date}2024-05-08T20:17:24.203+05:30"
jcr:lastModified="{Date}2024-05-08T20:17:24.203+05:30"
jcr:primaryType="nt:unstructured"
jcr:title="Responsive Text Input"
sling:resourceType="forms-components-examples/components/form/textinput"
fieldType="text-input"
name="textinput1715179644273">
<cq:responsive jcr:primaryType="nt:unstructured">
<default
jcr:primaryType="nt:unstructured"
offset="1"
width="9"/>
</cq:responsive>
</textinput1>
</guideContainer>
</jcr:content>
</jcr:root>
4 changes: 2 additions & 2 deletions parent/pom.xml
Expand Up @@ -88,8 +88,8 @@
<slf4j.version>1.7.6</slf4j.version>
<jacoco.version>0.7.9</jacoco.version>

<core.wcm.components.version>2.24.4</core.wcm.components.version>
<core.wcm.components.library.version>2.24.4</core.wcm.components.library.version>
<core.wcm.components.version>2.24.2</core.wcm.components.version>
<core.wcm.components.library.version>2.24.2</core.wcm.components.library.version>


<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Expand Up @@ -38,7 +38,7 @@
<div data-sly-call="${shortDescription.shortDescription @componentId=fragment.id, shortDescriptionVisible=fragment.tooltipVisible, shortDescription=fragment.tooltip, bemBlock='cmp-adaptiveform-fragment'}" data-sly-unwrap></div>
<div data-sly-call="${longDescription.longDescription @componentId=fragment.id, longDescription=fragment.description, bemBlock='cmp-adaptiveform-fragment'}" data-sly-unwrap></div>
<sly data-sly-test.showfragment="${wcmmode.preview || wcmmode.disabled}"
data-sly-repeat="${fragment.fragmentChildren}" data-sly-resource="${item.path @ decoration=true}"></sly>
data-sly-resource="${fragment.fragmentContainer @ resourceType='wcm/foundation/components/responsivegrid'}"></sly>
<sly data-sly-test="${ !showfragment }"
data-sly-use.placeholder="placeholder.html"
data-sly-call="${ placeholder.placeholder @ fragment=fragment, templates=templates }"></sly>
Expand Down
Expand Up @@ -109,7 +109,7 @@ describe("Sites with Aem Embed Container", () => {
it("model initialized properly", () => {
expect(formContainer, "formcontainer is initialized").to.not.be.null;
// fragment component, text field and IntanceManager
expect(Object.keys(formContainer._fields).length).to.equal(3);
expect(Object.keys(formContainer._fields).length).to.equal(4);
})

it("model's changes are reflected in the html ", () => {
Expand Down
21 changes: 14 additions & 7 deletions ui.tests/test-module/specs/fragment/fragment.runtime.spec.js
Expand Up @@ -21,7 +21,7 @@ describe("Form Runtime with Fragment", () => {
const selectors = {
textinput : `[data-cmp-is="${IS}"]`
}

const fragmentChildCount = 2;
let formContainer = null

beforeEach(() => {
Expand Down Expand Up @@ -100,7 +100,7 @@ describe("Form Runtime with Fragment", () => {

expect(fragmentView, "fragment view is created").to.not.be.null;
expect(textInputView, "fragment child view is created").to.not.be.null;
expect(fragmentView.children.length, "fragment has one child").to.equal(1);
expect(fragmentView.children.length, `fragment has ${fragmentChildCount} child`).to.equal(fragmentChildCount);
expect(fragmentView.children[0].id, "fragment has reference to child view").to.equal(textInputId);
expect(textInputView.parentView.id, "text input has reference to parent panel view").to.equal(fragmentId);

Expand All @@ -113,17 +113,24 @@ describe("Form Runtime with Fragment", () => {
it(" model's changes are reflected in the html ", () => {
const fragmentId = formContainer._model.items[0].items[0].id;
const model = formContainer._model.getElement(fragmentId);
const fragmentView = formContainer.getAllFields()[fragmentId];
const count = 1;
checkHTML(model.id, model.getState(), fragmentView, count).then(() => {
checkHTML(model.id, model.getState()).then(() => {
model.visible = false;
return checkHTML(model.id, model.getState(), fragmentView, count);
return checkHTML(model.id, model.getState());
}).then(() => {
model.enable = false;
return checkHTML(model.id, model.getState(), fragmentView, count);
return checkHTML(model.id, model.getState());
});
});

it("responsive component in fragment", () => {
const responsiveTextInputId = formContainer._model.items[0].items[0].items[1].id;
cy.get(`#${responsiveTextInputId}`).should('be.visible');
cy.get(`#${responsiveTextInputId}`).parent()
.should('have.class', 'aem-GridColumn')
.should('have.class', 'aem-GridColumn--default--9')
.should('have.class', 'aem-GridColumn--offset--default--1');
})

it(" add instance and remove instance of model is reflected in html ", () => {

const fragmentId = formContainer._model.items[0].items[0].id;
Expand Down
2 changes: 1 addition & 1 deletion ui.tests/test-module/specs/wizard/wizard.locale.spec.js
Expand Up @@ -15,7 +15,7 @@
******************************************************************************/
const afConstants = require("../../libs/commons/formsConstants");
const sitesSelectors = require("../../libs/commons/sitesSelectors");
describe.skip('Locale - Authoring Test', function () {
describe('Locale - Authoring Test', function () {
if(cy.af.isLatestAddon()) {
context('Test Wizard Component String Language', function () {
beforeEach(() => {
Expand Down

0 comments on commit 601db25

Please sign in to comment.