use of com.adobe.cq.wcm.core.components.models.ClientLibraries in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ClientLibrariesImplTest method testGetCategoriesWithInjectedResourceType.
@Test
void testGetCategoriesWithInjectedResourceType() {
Map<String, Object> attributes = new HashMap<>();
attributes.put("resourceTypes", new HashSet<String>() {
{
add("core/wcm/components/accordion/v1/accordion");
}
});
ClientLibraries clientlibs = getClientLibrariesUnderTest(ROOT_PAGE, attributes);
StringBuilder includes = new StringBuilder();
includes.append(jsIncludes.get(ACCORDION_CATEGORY));
includes.append(cssIncludes.get(ACCORDION_CATEGORY));
assertEquals(includes.toString(), clientlibs.getJsAndCssIncludes());
}
use of com.adobe.cq.wcm.core.components.models.ClientLibraries in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ClientLibrariesImplTest method testGetCategoriesWithInjectedResourceTypesAndInheritanceDisabled.
@Test
void testGetCategoriesWithInjectedResourceTypesAndInheritanceDisabled() {
Map<String, Object> attributes = new HashMap<>();
attributes.put("resourceTypes", new HashSet<String>() {
{
add("core/wcm/components/accordion/v1/accordion");
add("core/wcm/components/carousel/v3/carousel");
}
});
attributes.put("inherited", false);
ClientLibraries clientlibs = getClientLibrariesUnderTest(ROOT_PAGE, attributes);
StringBuilder includes = new StringBuilder();
includes.append(jsIncludes.get(ACCORDION_CATEGORY));
includes.append(cssIncludes.get(ACCORDION_CATEGORY));
assertEquals(includes.toString(), clientlibs.getJsAndCssIncludes());
}
use of com.adobe.cq.wcm.core.components.models.ClientLibraries in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ClientLibrariesImplTest method testGetCategoriesWithInjectedCategory.
@Test
void testGetCategoriesWithInjectedCategory() {
Map<String, Object> attributes = new HashMap<>();
attributes.put("categories", TEASER_CATEGORY);
ClientLibraries clientlibs = getClientLibrariesUnderTest(ROOT_PAGE, attributes);
StringBuilder includes = new StringBuilder();
includes.append(jsIncludes.get(TEASER_CATEGORY));
includes.append(cssIncludes.get(TEASER_CATEGORY));
assertEquals(includes.toString(), clientlibs.getJsAndCssIncludes());
}
Aggregations