use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testValidXFInTemplateWithLocalizationWithSameBlueprint.
/**
* Site with region localization (current page is a blueprint)
* XF component is defined in the template
* XF component points to the same region branch as the page
*/
@Test
void testValidXFInTemplateWithLocalizationWithSameBlueprint() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(PRODUCT_PAGE_TEMPLATE + "/structure/jcr:content/xf-component-50a", BLUEPRINT_PAGE);
assertEquals(XF_NAME, experienceFragment.getName());
Utils.testJSONExport(experienceFragment, Utils.getTestExporterJSONPath(TEST_BASE, "xf50a"));
}
use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testCaching.
/**
* Tests that methods that cache results return the same object on subsequent calls.
*/
@Test
void testCaching() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(NO_LOC_PAGE + "/jcr:content/root/xf-component-1");
assertNotNull(experienceFragment.getName());
assertSame(experienceFragment.getName(), experienceFragment.getName());
assertNotNull(experienceFragment.getCssClassNames());
assertSame(experienceFragment.getCssClassNames(), experienceFragment.getCssClassNames());
assertNotNull(experienceFragment.getExportedItems());
assertSame(experienceFragment.getExportedItems(), experienceFragment.getExportedItems());
assertNotNull(experienceFragment.getLocalizedFragmentVariationPath());
assertSame(experienceFragment.getLocalizedFragmentVariationPath(), experienceFragment.getLocalizedFragmentVariationPath());
}
use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testXFWithItems.
/**
* XF with content
*/
@Test
void testXFWithItems() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(PRODUCT_PAGE_TEMPLATE + "/structure/jcr:content/xf-component-70", LIVECOPY_PAGE);
assertEquals("header", experienceFragment.getName());
Utils.testJSONExport(experienceFragment, Utils.getTestExporterJSONPath(TEST_BASE, "xf70"));
}
use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testValidXFInTemplateWithLocalizationWithSameCountryLanguage.
/**
* Site with country-language localization
* XF component is defined in the template
* XF component points to the same country-language branch as the page
*/
@Test
void testValidXFInTemplateWithLocalizationWithSameCountryLanguage() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(PRODUCT_PAGE_TEMPLATE + "/structure/jcr:content/xf-component-20a", US_EN_PAGE);
assertEquals(XF_NAME, experienceFragment.getName());
Utils.testJSONExport(experienceFragment, Utils.getTestExporterJSONPath(TEST_BASE, "xf20a"));
}
use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testValidXFInTemplateWithoutLocalization.
/**
* No localization structure
* XF component is defined in the template
* fragmentVariationPath is valid
*/
@Test
void testValidXFInTemplateWithoutLocalization() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(PRODUCT_PAGE_TEMPLATE + "/structure/jcr:content/xf-component-1a", NO_LOC_PAGE);
assertEquals(XF_NAME, experienceFragment.getName());
Utils.testJSONExport(experienceFragment, Utils.getTestExporterJSONPath(TEST_BASE, "xf1a"));
}
Aggregations