use of com.adobe.cq.wcm.core.components.models.Breadcrumb in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class BreadcrumbImplTest method testGetHideCurrent.
@Test
public void testGetHideCurrent() throws Exception {
Resource resource = context.currentResource(CURRENT_PAGE + "/jcr:content/header/breadcrumb-hide-current");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
slingBindings.put(WCMBindings.CURRENT_STYLE, new MockStyle(resource));
underTest = context.request().adaptTo(Breadcrumb.class);
checkBreadcrumbConsistency(new String[] { "Women" });
}
use of com.adobe.cq.wcm.core.components.models.Breadcrumb in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class BreadcrumbImplTest method testStyleBasedBreadcrumb.
@Test
public void testStyleBasedBreadcrumb() throws Exception {
Resource resource = context.currentResource(CURRENT_PAGE + "/jcr:content/header/breadcrumb-style-based");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
Style style = mock(Style.class);
when(style.get(BreadcrumbImpl.PN_START_LEVEL, BreadcrumbImpl.PROP_START_LEVEL_DEFAULT)).thenReturn(3);
when(style.get(BreadcrumbImpl.PN_HIDE_CURRENT, BreadcrumbImpl.PROP_SHOW_HIDDEN_DEFAULT)).thenReturn(false);
when(style.get(BreadcrumbImpl.PN_SHOW_HIDDEN, BreadcrumbImpl.PROP_SHOW_HIDDEN_DEFAULT)).thenReturn(false);
slingBindings.put(WCMBindings.CURRENT_STYLE, style);
underTest = context.request().adaptTo(Breadcrumb.class);
checkBreadcrumbConsistency(new String[] { "Devi Sleeveless Shirt" });
}
use of com.adobe.cq.wcm.core.components.models.Breadcrumb in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class BreadcrumbImplTest method testStartLevel.
@Test
public void testStartLevel() throws Exception {
Resource resource = context.currentResource(CURRENT_PAGE + "/jcr:content/header/breadcrumb-start-level");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
slingBindings.put(WCMBindings.CURRENT_STYLE, new MockStyle(resource));
underTest = context.request().adaptTo(Breadcrumb.class);
checkBreadcrumbConsistency(new String[] { "Shirts", "Devi Sleeveless Shirt" });
}
use of com.adobe.cq.wcm.core.components.models.Breadcrumb in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class BreadcrumbImplTest method testBreadcrumbItems.
@Test
public void testBreadcrumbItems() throws Exception {
Resource resource = context.currentResource(CURRENT_PAGE + "/jcr:content/header/breadcrumb");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
slingBindings.put(WCMBindings.CURRENT_STYLE, new MockStyle(resource));
underTest = context.request().adaptTo(Breadcrumb.class);
checkBreadcrumbConsistency(new String[] { "Women", "Devi Sleeveless Shirt" });
}
use of com.adobe.cq.wcm.core.components.models.Breadcrumb in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class BreadcrumbImplTest method testGetShowHidden.
@Test
public void testGetShowHidden() throws Exception {
Resource resource = context.currentResource(CURRENT_PAGE + "/jcr:content/header/breadcrumb-show-hidden");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
slingBindings.put(WCMBindings.CURRENT_STYLE, new MockStyle(resource));
underTest = context.request().adaptTo(Breadcrumb.class);
checkBreadcrumbConsistency(new String[] { "Women", "Shirts", "Devi Sleeveless Shirt" });
}
Aggregations